Cytoscape 2.8.0 API

cytoscape.data
Class CyAttributesImpl

java.lang.Object
  extended by cytoscape.data.CyAttributesImpl
All Implemented Interfaces:
CyAttributes

public class CyAttributesImpl
extends Object
implements CyAttributes


Field Summary
protected static CyLogger logger
           
 
Fields inherited from interface cytoscape.data.CyAttributes
TYPE_BOOLEAN, TYPE_COMPLEX, TYPE_FLOATING, TYPE_INTEGER, TYPE_SIMPLE_LIST, TYPE_SIMPLE_MAP, TYPE_STRING, TYPE_UNDEFINED
 
Constructor Summary
CyAttributesImpl()
          Creates a new CyAttributesImpl object.
 
Method Summary
 boolean deleteAttribute(String attributeName)
          DOCUMENT ME!
 boolean deleteAttribute(String id, String attributeName)
          DOCUMENT ME!
 Object getAttribute(String id, String attributeName)
          Gets an Object value at the specified id/attributeName.
 String getAttributeDescription(String attributeName)
          DOCUMENT ME!
 List getAttributeList(String id, String attributeName)
           
 Map getAttributeMap(String id, String attributeName)
          DOCUMENT ME!
 String[] getAttributeNames()
          DOCUMENT ME!
 Boolean getBooleanAttribute(String id, String attributeName)
          DOCUMENT ME!
 Double getDoubleAttribute(String id, String attributeName)
          DOCUMENT ME!
 Equation getEquation(String id, String attributeName)
           
 Integer getIntegerAttribute(String id, String attributeName)
          DOCUMENT ME!
 String getLastEquationError()
          Returns any attribute-equation related error message after a call to getAttribute() or getXXXAttribute().
 List getListAttribute(String id, String attributeName)
          Gets a 'simple' list of attributes for the id/attributeName pair.
 byte getListElementType(String attributeName)
          Gets the member data type of the specified simple list attribute.
 Map getMapAttribute(String id, String attributeName)
          DOCUMENT ME!
 MultiHashMap getMultiHashMap()
          DOCUMENT ME!
 MultiHashMapDefinition getMultiHashMapDefinition()
          DOCUMENT ME!
 String getStringAttribute(String id, String attributeName)
          DOCUMENT ME!
 byte getType(String attributeName)
          DOCUMENT ME!
 boolean getUserEditable(String attributeName)
          DOCUMENT ME!
 boolean getUserVisible(String attributeName)
          DOCUMENT ME!
 boolean hasAttribute(String id, String attributeName)
          DOCUMENT ME!
 void setAttribute(String id, String attributeName, Boolean value)
          DOCUMENT ME!
 void setAttribute(String id, String attributeName, Double value)
          DOCUMENT ME!
 void setAttribute(String id, String attributeName, Equation equation)
           
 void setAttribute(String id, String attributeName, Equation equation, byte dataType)
           
 void setAttribute(String id, String attributeName, Integer value)
          DOCUMENT ME!
 void setAttribute(String id, String attributeName, String value)
          DOCUMENT ME!
 void setAttributeDescription(String attributeName, String description)
          DOCUMENT ME!
 void setListAttribute(String id, String attributeName, Equation equation)
          Sets a simple list of attributes.
 void setListAttribute(String id, String attributeName, List list)
          Sets a simple list of attributes.
 void setMapAttribute(String id, String attributeName, Map map)
          DOCUMENT ME!
 void setUserEditable(String attributeName, boolean value)
          DOCUMENT ME!
 void setUserVisible(String attributeName, boolean value)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final CyLogger logger
Constructor Detail

CyAttributesImpl

public CyAttributesImpl()
Creates a new CyAttributesImpl object.

Method Detail

setAttributeDescription

public void setAttributeDescription(String attributeName,
                                    String description)
DOCUMENT ME!

Specified by:
setAttributeDescription in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
description - DOCUMENT ME!

getAttributeDescription

public String getAttributeDescription(String attributeName)
DOCUMENT ME!

Specified by:
getAttributeDescription in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

setUserVisible

public void setUserVisible(String attributeName,
                           boolean value)
DOCUMENT ME!

Specified by:
setUserVisible in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
value - DOCUMENT ME!

getUserVisible

public boolean getUserVisible(String attributeName)
DOCUMENT ME!

Specified by:
getUserVisible in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

setUserEditable

public void setUserEditable(String attributeName,
                            boolean value)
DOCUMENT ME!

Specified by:
setUserEditable in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
value - DOCUMENT ME!

getUserEditable

public boolean getUserEditable(String attributeName)
DOCUMENT ME!

Specified by:
getUserEditable in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getAttributeNames

public String[] getAttributeNames()
DOCUMENT ME!

Specified by:
getAttributeNames in interface CyAttributes
Returns:
DOCUMENT ME!

hasAttribute

public boolean hasAttribute(String id,
                            String attributeName)
DOCUMENT ME!

Specified by:
hasAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

setAttribute

public void setAttribute(String id,
                         String attributeName,
                         Boolean value)
DOCUMENT ME!

Specified by:
setAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
value - DOCUMENT ME!

setAttribute

public void setAttribute(String id,
                         String attributeName,
                         Integer value)
DOCUMENT ME!

Specified by:
setAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
value - DOCUMENT ME!

setAttribute

public void setAttribute(String id,
                         String attributeName,
                         Double value)
DOCUMENT ME!

Specified by:
setAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
value - DOCUMENT ME!

setAttribute

public void setAttribute(String id,
                         String attributeName,
                         String value)
DOCUMENT ME!

Specified by:
setAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
value - DOCUMENT ME!

setAttribute

public void setAttribute(String id,
                         String attributeName,
                         Equation equation)
Specified by:
setAttribute in interface CyAttributes
Parameters:
id - unique identifier.
attributeName - attribute name.
equation - an attribute equation

setAttribute

public void setAttribute(String id,
                         String attributeName,
                         Equation equation,
                         byte dataType)
Specified by:
setAttribute in interface CyAttributes
Parameters:
id - unique identifier.
attributeName - attribute name.
equation - an attribute equation
dataType - must be one of MultiHashMapDefinition.TYPE_{BOOLEAN,STRING,INTEGER, or FLOATING_POINT}

getBooleanAttribute

public Boolean getBooleanAttribute(String id,
                                   String attributeName)
DOCUMENT ME!

Specified by:
getBooleanAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getIntegerAttribute

public Integer getIntegerAttribute(String id,
                                   String attributeName)
DOCUMENT ME!

Specified by:
getIntegerAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getDoubleAttribute

public Double getDoubleAttribute(String id,
                                 String attributeName)
DOCUMENT ME!

Specified by:
getDoubleAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getStringAttribute

public String getStringAttribute(String id,
                                 String attributeName)
DOCUMENT ME!

Specified by:
getStringAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getAttribute

public Object getAttribute(String id,
                           String attributeName)
Gets an Object value at the specified id/attributeName. This is a convenience method for those situations when attribute type isn't relevant. You should NOT use this method and cast the result to the type of attribute. Instead, just call the appropriate get*Attribute method.

Specified by:
getAttribute in interface CyAttributes
Parameters:
id - unique identifier.
attributeName - attribute name.
Returns:
Object, or null if no id/attributeName pair is found.

getType

public byte getType(String attributeName)
DOCUMENT ME!

Specified by:
getType in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getListElementType

public byte getListElementType(String attributeName)
Gets the member data type of the specified simple list attribute.

Specified by:
getListElementType in interface CyAttributes
Parameters:
attributeName - the name of a simple list attribute
Returns:
one of: TYPE_BOOLEAN, TYPE_INTEGER, TYPE_FLOATING, TYPE_STRING

deleteAttribute

public boolean deleteAttribute(String id,
                               String attributeName)
DOCUMENT ME!

Specified by:
deleteAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

deleteAttribute

public boolean deleteAttribute(String attributeName)
DOCUMENT ME!

Specified by:
deleteAttribute in interface CyAttributes
Parameters:
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

setListAttribute

public void setListAttribute(String id,
                             String attributeName,
                             List list)
Description copied from interface: CyAttributes
Sets a simple list of attributes.

A simple list is defined as follows:

If the above requirements are not met, an IllegalArgumentException will be thrown.

Implementation note: calling this method results in many calls to the MultiHashMap back-end data store. For example, if you have five elements in a List, the implementation code makes five calls to the MultiHashMap. Therefore, if you are listening to MultiHashMap events, you will be notified of five separate events, rather than one global list event.

Specified by:
setListAttribute in interface CyAttributes
Parameters:
id - unique identifier.
list - attribute name.

setListAttribute

public void setListAttribute(String id,
                             String attributeName,
                             Equation equation)
Description copied from interface: CyAttributes
Sets a simple list of attributes.

A simple list is defined as follows:

If the above requirements are not met, an IllegalArgumentException will be thrown.

Implementation note: calling this method results in many calls to the MultiHashMap back-end data store. For example, if you have five elements in a List, the implementation code makes five calls to the MultiHashMap. Therefore, if you are listening to MultiHashMap events, you will be notified of five separate events, rather than one global list event.

Specified by:
setListAttribute in interface CyAttributes
Parameters:
id - unique identifier.
equation - an attribute equation

getAttributeList

public List getAttributeList(String id,
                             String attributeName)
Specified by:
getAttributeList in interface CyAttributes

getListAttribute

public List getListAttribute(String id,
                             String attributeName)
Description copied from interface: CyAttributes
Gets a 'simple' list of attributes for the id/attributeName pair.

A 'simple' list is defined as follows:

Note: The returned List is useful for read operations only. If you add, edit, or delete elements within this list, these changes will not be stored, unless you explicitly call setListAttribute() again. For example:

 List list = nodeAttributes.getListAttribute(id, attributeName);

 //  Add new item
 list.add(new String("Hello, World");

 //  Save modified list back
 nodeAttributes.setListAttribute(id, attributeName, list);
 

Specified by:
getListAttribute in interface CyAttributes
Parameters:
id - unique identifier.
attributeName - attribute name.
Returns:
List object.

setMapAttribute

public void setMapAttribute(String id,
                            String attributeName,
                            Map map)
DOCUMENT ME!

Specified by:
setMapAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
map - DOCUMENT ME!

getAttributeMap

public Map getAttributeMap(String id,
                           String attributeName)
DOCUMENT ME!

Specified by:
getAttributeMap in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getMapAttribute

public Map getMapAttribute(String id,
                           String attributeName)
DOCUMENT ME!

Specified by:
getMapAttribute in interface CyAttributes
Parameters:
id - DOCUMENT ME!
attributeName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getMultiHashMap

public MultiHashMap getMultiHashMap()
DOCUMENT ME!

Specified by:
getMultiHashMap in interface CyAttributes
Returns:
DOCUMENT ME!

getMultiHashMapDefinition

public MultiHashMapDefinition getMultiHashMapDefinition()
DOCUMENT ME!

Specified by:
getMultiHashMapDefinition in interface CyAttributes
Returns:
DOCUMENT ME!

getEquation

public Equation getEquation(String id,
                            String attributeName)
Specified by:
getEquation in interface CyAttributes
Returns:
the equation associated with an attribute or null if there is no equation associated with it

getLastEquationError

public String getLastEquationError()
Returns any attribute-equation related error message after a call to getAttribute() or getXXXAttribute(). N.B., the last error message will be cached!

Specified by:
getLastEquationError in interface CyAttributes
Returns:
an error message or null if the last call to getAttribute() did not result in an equation related error

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.