|
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 MultiHashMapDefinition
This interface contains the API specification for creating attribute definitions.
Field Summary | |
---|---|
static byte |
TYPE_BOOLEAN
This type corresponds to java.lang.Boolean. |
static byte |
TYPE_FLOATING_POINT
This type corresponds to java.lang.Double. |
static byte |
TYPE_INTEGER
This type corresponds to java.lang.Integer. |
static byte |
TYPE_STRING
This type corresponds to java.lang.String. |
Method Summary | |
---|---|
void |
addDataDefinitionListener(MultiHashMapDefinitionListener listener)
Registers a listener for receiving events having to do with attribute definitions being created and deleted. |
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. |
byte |
getAttributeValueType(String attributeName)
Returns the type of attribute values that exist in specified attribute space. |
CountedIterator |
getDefinedAttributes()
Returns all defined attributeNames. |
void |
removeDataDefinitionListener(MultiHashMapDefinitionListener listener)
Unregisters a listener; this method has the opposite effect as addDataDefinitionListener(listener). |
boolean |
undefineAttribute(String attributeName)
WARNING: All bound attribute values on objects will go away in this attribute namespace when this method is called. |
Field Detail |
---|
static final byte TYPE_BOOLEAN
static final byte TYPE_FLOATING_POINT
static final byte TYPE_INTEGER
static final byte TYPE_STRING
Method Detail |
---|
void defineAttribute(String attributeName, byte valueType, byte[] keyTypes)
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.
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).
IllegalStateException
- if attributeName is already the name
of an existing attribute definition.
NullPointerException
- if attributeName is null.
IllegalArgumentException
- if valueType is not one of the
TYPE_* constants, or if keyTypes is [not null and] of positive length
and any one of its elements is not one of the TYPE_* constants.CountedIterator getDefinedAttributes()
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.
byte getAttributeValueType(String attributeName)
NullPointerException
- if attributeName is null.byte[] getAttributeKeyspaceDimensionTypes(String attributeName)
attributeName
- the attribute definition whose key space
we are querying.
IllegalStateException
- if attributeName is not an existing
attribute definition.
NullPointerException
- if attributeName is null.boolean undefineAttribute(String attributeName)
attributeName
- the attribute definition to undefine.
NullPointerException
- if attributeName is null.void addDataDefinitionListener(MultiHashMapDefinitionListener listener)
listener
- the listener to register.void removeDataDefinitionListener(MultiHashMapDefinitionListener 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 |