|
Cytoscape 2.3.1 (c) 2004 ISB, MSKCC, UCSD | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.data.attr.util.MultiHashMapModel
cytoscape.data.attr.util.ExtensibleMultiHashMapModel
Please try to restrain from using this class. This class was created so that certain legacy applications would have an easier time integrating with the functionality provided by the MultiHashMap and MultiHashMapDefinition implementations.
MultiHashMapFactory
Field Summary |
Fields inherited from interface cytoscape.data.attr.MultiHashMapDefinition |
TYPE_BOOLEAN, TYPE_FLOATING_POINT, TYPE_INTEGER, TYPE_STRING |
Constructor Summary | |
ExtensibleMultiHashMapModel()
Deprecated. |
Method Summary | |
void |
addDataDefinitionListener(MultiHashMapDefinitionListener listener)
Registers a listener for receiving events having to do with attribute definitions being created and deleted. |
void |
addDataListener(MultiHashMapListener listener)
Registers a listener for receiving events having to do with attribute values being assigned and removed. |
void |
defineAttribute(String attributeName,
byte valueType,
byte[] keyTypes)
Creates an attribute definition. |
byte[] |
getAttributeKeyspaceDimensionTypes(String attributeName)
Returns information about the dimensionality and types in the key space of specified attribute. |
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. |
byte |
getAttributeValueType(String attributeName)
Returns the type of attribute values that exist in specified attribute space. |
CountedIterator |
getDefinedAttributes()
Returns all defined attributeNames. |
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 |
removeDataDefinitionListener(MultiHashMapDefinitionListener listener)
Unregisters a listener; this method has the opposite effect as addDataDefinitionListener(listener). |
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. |
boolean |
undefineAttribute(String attributeName)
WARNING: All bound attribute values on objects will go away in this attribute namespace when this method is called. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExtensibleMultiHashMapModel()
Method Detail |
public final void defineAttribute(String attributeName, byte valueType, byte[] keyTypes)
MultiHashMapDefinition
Perhaps the most common type of attribute definition is one where the key space has zero dimensions. For example, if I want to identify each object as having a color, I would create an attribute definition which stores values of TYPE_STRING (for storing "red", "blue", and so on) and has no key sequence mapping color values. By "no key sequence" I mean that the input parameter keyTypes would be either null or the empty array for my color attribute definition.
The more interesting case is where the key space in an attribute definition has one or more dimensions. For example, if I wanted to create an attribute that represents measured p-values for all objects over a set of experiments ("Ideker experiment", "Salk experiment", ...) I would define a one-dimensional key space of TYPE_STRING (to represent the experiment names) and a value of TYPE_FLOATING_POINT (to represent p-values).
NOTE: No constraints on attributeName are documented by this API. In other words, as far as this API is concerned, any attributeName is acceptable, including the empty string (""). The only necessary condition is that each attributeName be unique.
defineAttribute
in interface MultiHashMapDefinition
attributeName
- an identifier for this attribute definition;
this value must be unique from all existing attribute definitions;
ideally, the choice of name would describe values being stored by this
attribute definition.valueType
- one of the TYPE_* constants defining what type of
values are bound to objects in this attribute definition.keyTypes
- defines the type (TYPE_*) of each dimension in the key
space;
the entry at index i defines the type of key space dimension i + 1;
this parameter may either be null or the empty array if an attribute
definition does not use a key space (this is perhaps the most common
scenario).public final CountedIterator getDefinedAttributes()
MultiHashMapDefinition
NOTE: The returned iterator does not support the remove() operation.
NOTE: To find out whether or not an attributeName is defined, use getAttributeValueType(attributeName) and test whether or not the return value is negative.
IMPORTANT: The returned iterator becomes invalid as soon as any attributeName is defined or undefined in this MultiHashMapDefinition. Calling methods on an invalid iterator will result in undefined behavior of that iterator.
getDefinedAttributes
in interface MultiHashMapDefinition
public final byte getAttributeValueType(String attributeName)
MultiHashMapDefinition
getAttributeValueType
in interface MultiHashMapDefinition
public final byte[] getAttributeKeyspaceDimensionTypes(String attributeName)
MultiHashMapDefinition
getAttributeKeyspaceDimensionTypes
in interface MultiHashMapDefinition
attributeName
- the attribute definition whose key space
we are querying.
public final boolean undefineAttribute(String attributeName)
MultiHashMapDefinition
undefineAttribute
in interface MultiHashMapDefinition
attributeName
- the attribute definition to undefine.
public final void addDataDefinitionListener(MultiHashMapDefinitionListener listener)
MultiHashMapDefinition
addDataDefinitionListener
in interface MultiHashMapDefinition
listener
- the listener to register.public final void removeDataDefinitionListener(MultiHashMapDefinitionListener listener)
MultiHashMapDefinition
removeDataDefinitionListener
in interface MultiHashMapDefinition
listener
- the listener to unregister.public final Object setAttributeValue(String objectKey, String attributeName, Object attributeValue, Object[] keyIntoValue)
MultiHashMap
setAttributeValue
in interface MultiHashMap
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.
public final Object getAttributeValue(String objectKey, String attributeName, Object[] keyIntoValue)
MultiHashMap
getAttributeValue
in interface MultiHashMap
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.
public final Object removeAttributeValue(String objectKey, String attributeName, Object[] keyIntoValue)
MultiHashMap
removeAttributeValue
in interface MultiHashMap
MultiHashMap.getAttributeValue(String, String, Object[])
public final boolean removeAllAttributeValues(String objectKey, String attributeName)
MultiHashMap
removeAllAttributeValues
in interface MultiHashMap
objectKey
- the object from which to delete all bound attribute
values.attributeName
- the attribute definition in which to delete
attribute values.
public final CountedIterator getAttributeKeyspan(String objectKey, String attributeName, Object[] keyPrefix)
MultiHashMap
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.
getAttributeKeyspan
in interface MultiHashMap
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.
public final CountedIterator getObjectKeys(String attributeName)
MultiHashMap
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.
getObjectKeys
in interface MultiHashMap
attributeName
- the attribute definition to query.
MultiHashMapDefinition.getAttributeValueType(String)
public final void addDataListener(MultiHashMapListener listener)
MultiHashMap
addDataListener
in interface MultiHashMap
listener
- the listener to register.public final void removeDataListener(MultiHashMapListener listener)
MultiHashMap
removeDataListener
in interface MultiHashMap
listener
- the listener to unregister.
|
www.cytoscape.org | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |