Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.data.attr.util
Class MultiHashMapHelpers

java.lang.Object
  extended by cytoscape.data.attr.util.MultiHashMapHelpers

public final class MultiHashMapHelpers
extends Object

This class contains static utilitarian methods that return information pertaining to attributes. The reason why the methods here are defined in this helper class and not in MultiHashMap is that the return values in these methods are simply computed using the public API methods of MultiHashMap. MultiHashMapHelpers is an implementation layer on top of MultiHashMap, whereas MultiHashMap provides only those methods which are either essential to its API or are optimized by its implementation.


Method Summary
static List getAllAttributeKeys(String objectKey, String attributeName, MultiHashMap cyData, MultiHashMapDefinition cyDataDef)
          Convenience method for discovering all key sequnces that map into bound values; this method is primarily useful with attribute definitions that have nonzero key spaces.
static List getAllAttributeKeysAlongPrefix(String objectKey, String attributeName, Object[] keyPrefix, MultiHashMap cyData, MultiHashMapDefinition cyDataDef)
          Convenience method for discovering all key sequences having a given prefix that map into bound values; this method is primarily useful with attribute definitions that have nonzero key spaces.
static List getAllAttributeValues(String objectKey, String attributeName, MultiHashMap cyData, MultiHashMapDefinition cyDataDef)
          Convenience method for discovering all attribute values on an object in a given attribute definition; this method is only useful with attribute definitions that have nonzero key spaces.
static List getAllAttributeValuesAlongPrefix(String objectKey, String attributeName, Object[] keyPrefix, MultiHashMap cyData, MultiHashMapDefinition cyDataDef)
          Convenience method for discovering attribute values along a specified key prefix; this method is only useful with attribute definitions that have nonzero key spaces.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllAttributeValues

public static List getAllAttributeValues(String objectKey,
                                         String attributeName,
                                         MultiHashMap cyData,
                                         MultiHashMapDefinition cyDataDef)
Convenience method for discovering all attribute values on an object in a given attribute definition; this method is only useful with attribute definitions that have nonzero key spaces.

Parameters:
objectKey - the object whose attribute values to return.
attributeName - the attribute definition in which to find attribute values.
cyData - the data repository to use to dig for attribute values.
cyDataDef - the data definition registry to use to find out about the dimensionality of attributeName.
Returns:
a list of all bound values on objectKey in attributeName, with duplicate values included; the returned list is never null; elements in the returned list are ordered arbitrarily; subsequent operations on cyData or cyDataDef will have no effect on the returned list.
Throws:
IllegalStateException - if attributeName is not an existing attribute definition in cyData and cyDataDef.
NullPointerException - if any one of the input parameters is null.

getAllAttributeValuesAlongPrefix

public static List getAllAttributeValuesAlongPrefix(String objectKey,
                                                    String attributeName,
                                                    Object[] keyPrefix,
                                                    MultiHashMap cyData,
                                                    MultiHashMapDefinition cyDataDef)
Convenience method for discovering attribute values along a specified key prefix; this method is only useful with attribute definitions that have nonzero key spaces.

Parameters:
objectKey - the object whose attribute values to return.
attributeName - the attribute definition in which to find attribute values.
keyPrefix - an array of length less than or equal to 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 all attribute values bound to objectKey in attributeName will be returned; if keyPrefix is not empty, all bound values having key sequences whose beginning matches the specified prefix will be returned.
cyData - the data repository to use to dig for attribute values.
cyDataDef - the data definition registry to use to find out about the dimensionality of attributeName.
Returns:
a list of all bound values on objectKey in attributeName along key space prefix keyPrefix, with duplicate values included; the returned list is never null; elements in the returned list are ordered arbitrarily; subsequent operations on cyData or cyDataDef will have no effect on the returned list.
Throws:
IllegalStateException - if attributeName is not an existing attribute definition in cyData and cyDataDef.
NullPointerException - if any one of the input parameters except keyPrefix is null, or if keyPrefix is of positive length and any one of its entries is null.
ClassCastException - if keyPrefix is of positive length and any one of its entries does not match the type of object specified by corresponding dimension type in attributeName's definition.
IllegalArgumentException - if keyPrefix's length is greater than the dimensionality of attributeName's key space.

getAllAttributeKeys

public static List getAllAttributeKeys(String objectKey,
                                       String attributeName,
                                       MultiHashMap cyData,
                                       MultiHashMapDefinition cyDataDef)
Convenience method for discovering all key sequnces that map into bound values; this method is primarily useful with attribute definitions that have nonzero key spaces.

Parameters:
objectKey - the object whose mapped attribute keys to return.
attributeName - the attribute definition in which to find attribute keys.
cyData - the data repository to use to discover attribute keys.
cyDataDef - the data definition registry to use to find out about the dimensionality of attributeName.
Returns:
a list of Object[]; each Object[] in the returned list is a unique key sequence into a bound value; the returned list is never null and always contains the full set of key sequences registered on objectKey in attributeName; subsequent operations on cyData or cyDataDef will have no effect on the returned list.
Throws:
IllegalStateException - if attributeName is not an existing attribute definition in cyData and cyDataDef.
NullPointerException - if any one of the input parameters is null.

getAllAttributeKeysAlongPrefix

public static List getAllAttributeKeysAlongPrefix(String objectKey,
                                                  String attributeName,
                                                  Object[] keyPrefix,
                                                  MultiHashMap cyData,
                                                  MultiHashMapDefinition cyDataDef)
Convenience method for discovering all key sequences having a given prefix that map into bound values; this method is primarily useful with attribute definitions that have nonzero key spaces.

Parameters:
objectKey - the object whose mapped attribute keys to return.
attributeName - the attribute definition in which to find attribute keys.
keyPrefix - an array of length less than or equal to 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 all attribute key sequences mapped to attribute values for objectKey in attributeName will be returned; if keyPrefix is not empty, all mapped key sequences having prefix keyPrefix will be returned.
cyData - the data repository to use to discover attribute keys.
cyDataDef - the data definition registry to use to find out about the dimensionality of attributeName.
Returns:
a list of Object[]; each Object[] in the returned list is a unique key sequence whose beginning matches keyPrefix and which is mapped to a value; the returned list contains all such key sequences; the return value is never null; subsequent operations on cyData or cyDataDef will have no effect on the returned list.
Throws:
IllegalStateException - if attributeName is not an existing attribute definition in cyData and cyDataDef.
NullPointerException - if any one of the input parameters except keyPrefix is null, or if keyPrefix is of positive length and any one of its entries is null.
ClassCastException - if keyPrefix is of positive length and any one of its entries does not match the type of object specified by corresponding dimension type in attributeName's definition.
IllegalArgumentException - if keyPrefix's length is greater than the dimensionality of attributeName's key space.

www.cytoscape.org