|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.data.CyAttributesImpl
public class CyAttributesImpl
Field Summary |
---|
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()
|
Method Summary | |
---|---|
boolean |
deleteAttribute(String attributeName)
Deletes the specified attribute. |
boolean |
deleteAttribute(String id,
String attributeName)
Deletes the id/attributeName pair. |
List |
getAttributeList(String id,
String attributeName)
Gets a 'simple' list of attributes for the id/attributeName pair. |
Map |
getAttributeMap(String id,
String attributeName)
Gets a 'simple' map of attribute values. |
String[] |
getAttributeNames()
Gets an array of all attribute names. |
Boolean |
getBooleanAttribute(String id,
String attributeName)
Gets a Boolean value at the specified id/attributeName. |
Double |
getDoubleAttribute(String id,
String attributeName)
Gets a Double value at the specified id/attributeName. |
Integer |
getIntegerAttribute(String id,
String attributeName)
Gets an Integer value at the specified id/attributeName. |
MultiHashMap |
getMultiHashMap()
Gets the MultiHashMap Object, where we store attribute values. |
MultiHashMapDefinition |
getMultiHashMapDefinition()
Gets the MultiHashMapDefinition Object, where we store attribute definitions. |
String |
getStringAttribute(String id,
String attributeName)
Gets a String value at the specified id/attributeName. |
byte |
getType(String attributeName)
Gets the data type of the specified attribute. |
boolean |
hasAttribute(String id,
String attributeName)
Determines if the specified id/attributeName pair exists. |
void |
setAttribute(String id,
String attributeName,
Boolean value)
Sets an id/attributeName pair of type Boolean. |
void |
setAttribute(String id,
String attributeName,
Double value)
Sets an id/attributeName pair of type Double. |
void |
setAttribute(String id,
String attributeName,
Integer value)
Sets an id/attributeName pair of type Integer. |
void |
setAttribute(String id,
String attributeName,
String value)
Sets an id/attributeName pair of type String. |
void |
setAttributeList(String id,
String attributeName,
List list)
Sets a simple list of attributes. |
void |
setAttributeMap(String id,
String attributeName,
Map map)
Sets a 'simple' map of attribute values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CyAttributesImpl()
Method Detail |
---|
public String[] getAttributeNames()
CyAttributes
getAttributeNames
in interface CyAttributes
public boolean hasAttribute(String id, String attributeName)
CyAttributes
hasAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public void setAttribute(String id, String attributeName, Boolean value)
CyAttributes
setAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.value
- boolean value.public void setAttribute(String id, String attributeName, Integer value)
CyAttributes
setAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.value
- integer value.public void setAttribute(String id, String attributeName, Double value)
CyAttributes
setAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.value
- double value.public void setAttribute(String id, String attributeName, String value)
CyAttributes
setAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.value
- string value.public Boolean getBooleanAttribute(String id, String attributeName)
CyAttributes
getBooleanAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public Integer getIntegerAttribute(String id, String attributeName)
CyAttributes
getIntegerAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public Double getDoubleAttribute(String id, String attributeName)
CyAttributes
getDoubleAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public String getStringAttribute(String id, String attributeName)
CyAttributes
getStringAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public byte getType(String attributeName)
CyAttributes
getType
in interface CyAttributes
attributeName
- Attribute Name.
public boolean deleteAttribute(String id, String attributeName)
CyAttributes
deleteAttribute
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public boolean deleteAttribute(String attributeName)
CyAttributes
Calling this method deletes all id/attributeName pairs with this attributeName, and resets the specified attribute data type to: TYPE_UNDEFINED. Please use with caution!
deleteAttribute
in interface CyAttributes
attributeName
- attribute name.
public void setAttributeList(String id, String attributeName, List list)
CyAttributes
A simple list is defined as follows:
Boolean
, Integer
,
Double
or String
.
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.
setAttributeList
in interface CyAttributes
id
- unique identifier.list
- attribute name.public List getAttributeList(String id, String attributeName)
CyAttributes
A 'simple' list is defined as follows:
Boolean
, Integer
,
Double
or String
.
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 setAttributeList() again. For example:
List list = nodeAttributes.getAttributeList(id, attributeName); // Add new item list.add(new String("Hello, World"); // Save modified list back nodeAttributes.setAttributeList(id, attributeName, list);
getAttributeList
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public void setAttributeMap(String id, String attributeName, Map map)
CyAttributes
A 'simple' map is defined as follows:
Boolean
, Integer
,
Double
or String
.
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 Map, 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 map event.
setAttributeMap
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.map
- Map Object.public Map getAttributeMap(String id, String attributeName)
CyAttributes
A 'simple' map is defined as follows:
Boolean
, Integer
,
Double
or String
.
Note: The returned Map is useful for read operations only. If you add, edit, or delete elements within this Map, these changes will not be stored, unless you explicitly call setAttributeMap() again. For example:
Map map = nodeAttributes.getAttributeMap(id, attributeName); // Add new item map.put(new String("Message"), new String("Hello, World")); // Save modified map back nodeAttributes.setAttributeMap(id, attributeName, map);
getAttributeMap
in interface CyAttributes
id
- unique identifier.attributeName
- attribute name.
public MultiHashMap getMultiHashMap()
CyAttributes
By using MultiHashMap and MultiHashMapDefinition directly, you can store arbitrarily complex data structures. Recommended for advanced coders only.
getMultiHashMap
in interface CyAttributes
public MultiHashMapDefinition getMultiHashMapDefinition()
CyAttributes
By using MultiHashMap and MultiHashMapDefinition directly, you can store arbitrarily complex data structures (e.g. anything more complicated that 'simple' lists and 'simple' maps). Recommended for advanced coders only.
getMultiHashMapDefinition
in interface CyAttributes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |