|
Cytoscape 2.8.0 API | |||||||||
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 boolean |
copyAttribute(CyAttributes attribs,
String sourceId,
String targetId,
String attribName,
boolean copyEquation,
StringBuilder errorMessage)
|
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 boolean |
isNullAttribute(String attributeType,
String attributeName)
Check if all the values for an attribute are NULL. |
static byte |
toByte(String attributeType)
Return a byte representation of the various CyAttributes types returned by methods like CyAttributes.getType() and MultiHashMapDefinition.getAttributeKeysapceDimensionTypes(). |
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 |
---|
clone, equals, finalize, 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 boolean copyAttribute(CyAttributes attribs, String sourceId, String targetId, String attribName, boolean copyEquation, StringBuilder errorMessage)
copyEquation
- if true, and the source contains an equation, the equation and not the value will be copiederrorMessage
- will be set to an explanatory text should the copy operation fail
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)
public static byte toByte(String attributeType)
CyAttributes.getType(java.lang.String)
,
MultiHashMapDefinition.getAttributeKeyspaceDimensionTypes(java.lang.String)
public static boolean isNullAttribute(String attributeType, String attributeName)
attributeType
- "node" or "edge"attributeName
- attribute name.
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |