|
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 |
java.lang.Object cytoscape.data.CyAttributesUtils
public class CyAttributesUtils
Nested Class Summary | |
---|---|
static class |
CyAttributesUtils.AttributeType
|
Field Summary | |
---|---|
static AttributeFilter |
ALL_ATTRIBUTES_FILTER
An AttributeFilter that produces all attributes--none are filtered out. |
Constructor Summary | |
---|---|
CyAttributesUtils()
|
Method Summary | |
---|---|
static void |
copyAttribute(String originalID,
String copyID,
String attrName,
CyAttributes attrs,
boolean purge)
Copy a specific attribute of a given object to another object. |
static void |
copyAttributes(String originalID,
String copyID,
CyAttributes attrs,
AttributeFilter filter,
boolean purge)
Copy all the attributes of a given object that pass a given filter to another object. |
static void |
copyAttributes(String originalID,
String copyID,
CyAttributes attrs,
boolean purge)
Copy all the attributes of a given object to another object. |
static Map |
getAttribute(String attributeName,
CyAttributes attrs)
DOCUMENT ME! |
static List<String> |
getAttributeNamesForObj(String objID,
CyAttributes attrs)
Return a non-null List of all the attribute names associated with a given identifier for a given CyAttributes. |
static Map<String,Object> |
getAttributes(String canonicalName,
CyAttributes attrs)
DOCUMENT ME! |
static Class |
getClass(String attributeName,
CyAttributes attrs)
DOCUMENT ME! |
static List<String> |
getIDListFromAttributeValue(CyAttributesUtils.AttributeType type,
String attrName,
Object attrValue)
Get list of IDs associated with a specific attribute value. |
static List<String> |
getVisibleAttributeNames(CyAttributes attrs)
DOCUMENT ME! |
static String |
toString(byte atype)
Return a String representation of the various CyAttributes types returned by methods like CyAttributes.getType() and MultiHashMapDefinition.getAttributeKeysapceDimensionTypes(). |
static void |
traverseAttributeValues(String objToTraverseID,
String attrName,
CyAttributes attrs,
AttributeValueVisitor visitor)
Traverse all the values of a given attribute applying an AttributeValueVisitor to each value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final AttributeFilter ALL_ATTRIBUTES_FILTER
Constructor Detail |
---|
public CyAttributesUtils()
Method Detail |
---|
public static Map getAttribute(String attributeName, CyAttributes attrs)
attributeName
- DOCUMENT ME!attrs
- DOCUMENT ME!
public static Map<String,Object> getAttributes(String canonicalName, CyAttributes attrs)
canonicalName
- DOCUMENT ME!attrs
- DOCUMENT ME!
public static Class getClass(String attributeName, CyAttributes attrs)
attributeName
- DOCUMENT ME!attrs
- DOCUMENT ME!
public static List<String> getVisibleAttributeNames(CyAttributes attrs)
attrs
- DOCUMENT ME!
public static void copyAttributes(String originalID, String copyID, CyAttributes attrs, boolean purge)
copyAttributes (originalID, copyID, attrs, ALL_ATTRIBUTES_FILTER, purge).
copyAttributes(String,String,CyAttributes,AttributeFilter,boolean)
public static void copyAttributes(String originalID, String copyID, CyAttributes attrs, AttributeFilter filter, boolean purge)
originalID
- the identifier of the object we are copying
from (e.g, equivalent to CyNode.getIdentifier()).copyID
- the identifier of the object we are copying to.attrs
- the CyAttributes from which to copy and retrieve the attributes.filter
- an AttributeFilter that determines if a given attribute should
be copied. The filter is applied to all attributes stored un originalID.
An attribute will we copied iff filter.includeAttribute() returns true.
To copy all attributes, use ALL_ATTRIBUTES_FILTER
.purge
- true iff existing attribute values associated with
the object represented by copyID are to be removed
before copying the new attribute values from the
object represented by originalID. This is useful
when copying to an existing object that contained
previous attribute values. This should be false
for newly created, objects that have no previous
attribute values.
IllegalArgumentException
- if originalID, copyID, attrs,
or filter are null; or if originalID==copyID.public static void copyAttribute(String originalID, String copyID, String attrName, CyAttributes attrs, boolean purge)
originalID
- the identifier of the object we are copying
from (e.g, equivalent to CyNode.getIdentifier()).copyID
- the identifier of the object we are copying to.attrName
- the name of the attribute we wish to copy.attrs
- the CyAttributes from which to copy and retrieve the attribute.purge
- true iff existing attribute values associated with
the object represented by copyID are to be removed
before copying the new attribute values from the
object represented by originalID. This is useful
when copying to an existing object that contained
previous attribute values. This should be false
for newly created, objects that have no previous
attribute values.
IllegalArgumentException
- if originalID, copyID,
attrName, or attrs are null; or if originalID==copyID.public static void traverseAttributeValues(String objToTraverseID, String attrName, CyAttributes attrs, AttributeValueVisitor visitor)
objToTraverseID
- the identifier of the object containing
the attribute of interest.attrName
- the name of the attribute for which we are to
traverse values.attrs
- the CyAttributes that contains the attribute of interest.visitor
- an AttributeValueVisitor to be applied to each
value of the attribute being traversed. For
example, to print out all attribute values, we
could perform:
traverseAttributeValues ("testObject", "testAttributeName", Cytoscape.getNodeAttributes(), new AttributeValueVisitor () { public void visitingAttributeValue (String objTraversedID, String attrName, CyAttributes attrs, Object[] keySpace, Object visitedValue) { CyLogger.getLogger().info ("traversing " + visitedValue); }});No traversal is performed if objToTraverseID or attrName are null, or if objToTraverseID has no associated attrName attribute.
public static List<String> getAttributeNamesForObj(String objID, CyAttributes attrs)
objID
- the identifier of the object of interest.attrs
- the CyAttributes from which to check for attributes.public static List<String> getIDListFromAttributeValue(CyAttributesUtils.AttributeType type, String attrName, Object attrValue)
attr
- DOCUMENT ME!attrName
- DOCUMENT ME!attrValue
- DOCUMENT ME!
public static String toString(byte atype)
CyAttributes.getType(java.lang.String)
,
MultiHashMapDefinition.getAttributeKeyspaceDimensionTypes(java.lang.String)
|
www.cytoscape.org | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |