|
Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MultiHashMap
This interface consists of the API specification to bind attribute values to objects. A sibling API is MultiHashMapDefinition, which is used to define attribute spaces in which attribute values can be bound to objects; attribute space definition is the first thing that happens.
Method Summary | |
---|---|
void |
addDataListener(MultiHashMapListener listener)
Registers a listener for receiving events having to do with attribute values being assigned and removed. |
CountedIterator |
getAttributeKeyspan(String objectKey,
String attributeName,
Object[] keyPrefix)
For all key sequences, having specified prefix, that map into bound values on objectKey in attributeName, returns the [unique] representatives from dimension keyPrefix.length + 1. |
Object |
getAttributeValue(String objectKey,
String attributeName,
Object[] keyIntoValue)
Retrieves a bound attribute value from an object. |
CountedIterator |
getObjectKeys(String attributeName)
Returns all objectKeys that have at least one attribute value assigned in attributeName. |
boolean |
removeAllAttributeValues(String objectKey,
String attributeName)
Removes all values bound to objectKey in attributeName. |
Object |
removeAttributeValue(String objectKey,
String attributeName,
Object[] keyIntoValue)
This method is the same as getAttributeValue(), only the retrieved attribute value is also deleted. |
void |
removeDataListener(MultiHashMapListener listener)
Unregisters a listener; this method has the opposite effect as addDataListener(listener). |
Object |
setAttributeValue(String objectKey,
String attributeName,
Object attributeValue,
Object[] keyIntoValue)
Binds an attribute value to an object. |
Method Detail |
---|
Object setAttributeValue(String objectKey, String attributeName, Object attributeValue, Object[] keyIntoValue)
objectKey
- the object to which to bind a new attribute value.attributeName
- the attribute definition in which to assign an
attribute value.attributeValue
- the attribute value to bind;
the type of this object must be of the appropriate type based on
the value type of specified attribute definition.keyIntoValue
- an array of length equal to the dimensionality of
the key space of specified attribute definition; entry at index i
is a "representative" from dimension i + 1 of the key space; if
specified attribute definition has a zero-dimensional key space (this
is perhaps the most common scenario) then
this array may either be null or the empty array.
IllegalStateException
- if attributeName is not an existing
attribute definition; see MultiHashMapDefinition.
NullPointerException
- if objectKey, attributeName, or
attributeValue is null, or if keyIntoValue is [not null and]
of positive length and any one of its entries is null.
ClassCastException
- if attributeValue is not of the
appropriate object type or if any one of keyIntoValue's representatives
is not of the appropriate object type; see MultiHashMapDefinition.
IllegalArgumentException
- if keyIntoValue's length does not
match the key space dimensionality of attributeName.Object getAttributeValue(String objectKey, String attributeName, Object[] keyIntoValue)
objectKey
- the object from which to retrieve a bound attribute
value.attributeName
- the attribute definition in which assigned
attribute value exists.keyIntoValue
- an array of length equal to the dimensionality of
the key space of specified attribute definition; entry at index i
is a "representative" from dimension i + 1 of the key space; if
specified attribute definition has a zero-dimensional key space (this
is perhaps the most commen scenario) then this array may either
be null or the empty array.
IllegalStateException
- if attributeName is not an existing
attribute definition; see MultiHashMapDefinition.
NullPointerException
- if objectKey or attributeName is null,
or if keyIntoValue is [not null and] of positive length and any one
of its entries is null.
ClassCastException
- if any one of keyIntoValue's representatives
is not of the appropriate object type; see MultiHashMapDefinition.
IllegalArgumentException
- if keyIntoValue's length does not
match the key space dimensionality of attributeName.Object removeAttributeValue(String objectKey, String attributeName, Object[] keyIntoValue)
getAttributeValue(String, String, Object[])
boolean removeAllAttributeValues(String objectKey, String attributeName)
objectKey
- the object from which to delete all bound attribute
values.attributeName
- the attribute definition in which to delete
attribute values.
IllegalStateException
- if attributeName is not an existing
attribute definition; see MultiHashMapDefinition.
NullPointerException
- if objectKey or attributeName is null.CountedIterator getAttributeKeyspan(String objectKey, String attributeName, Object[] keyPrefix)
NOTE: The returned iterator does not support the remove() operation.
IMPORTANT: The returned iterator becomes invalid as soon as any attribute value is set or removed for some objectKey in attributeName. Calling methods on an invalid iterator will result in undefined behavior of that iterator.
objectKey
- the object to query.attributeName
- the attribute definition to query.keyPrefix
- an array of length K, where K is strictly less than
the dimensionality of key space of attributeName;
entry at index i contains a "representative" from dimension i + 1 of
the key space of attributeName; keyPrefix may
be either null or the empty array, in which case the iterator
returned consists of the representatives in the first dimension of
key space.
IllegalStateException
- if attributeName is not an existing
attribute definition; see MultiHashMapDefinition.
NullPointerException
- if objectKey or attributeName is null,
or if keyPrefix is [not null and] of positive length and any one
of its entries is null.
ClassCastException
- if any one of keyPrefix's representatives
is not of the appropriate object type; see MultiHashMapDefinition.
IllegalArgumentException
- if keyPrefix's length is not
strictly less than the dimensionality of attributeName's key space.CountedIterator getObjectKeys(String attributeName)
NOTE: The returned iterator does not support the remove() operation.
NOTE: To quickly determine whether or not a given objectKey has at least one attribute value bound to it under attributeName, test for a null return value in getAttributeValue(objectKey, attributeName, null) if attributeName has zero key space dimensionality, or test for an empty iterator return value in getAttributeKeyspan(objectKey, attributeName, null) if attributeName has nonzero key space dimensionality.
IMPORTANT: The returned iterator becomes invalid as soon as any attribute value is set or removed for some objectKey in attributeName. Calling methods on an invalid iterator will result in undefined behavior of that iterator.
attributeName
- the attribute definition to query.
IllegalStateException
- if attributeName is not an existing
attribute definition; to test whether or not attributeName is an
existing attribute definition, use
MultiHashMapDefinition.getAttributeValueType(attributeName).
NullPointerException
- if attributeName is null.MultiHashMapDefinition.getAttributeValueType(String)
void addDataListener(MultiHashMapListener listener)
listener
- the listener to register.void removeDataListener(MultiHashMapListener listener)
listener
- the listener to unregister.
|
www.cytoscape.org | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |