Package ghidra.util.graph.attributes
Class ObjectAttribute<T extends KeyedObject>
- java.lang.Object
-
- ghidra.util.graph.attributes.Attribute<T>
-
- ghidra.util.graph.attributes.ObjectAttribute<T>
-
public class ObjectAttribute<T extends KeyedObject> extends Attribute<T>
This class provides a storage mechanism for Object-valued information about the elements of a KeyIndexableSet, e.g. the vertices of a DirectedGraph.
-
-
Constructor Summary
Constructors Constructor Description ObjectAttribute(java.lang.String name, KeyIndexableSet<T> set)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringattributeType()Return the type of Attribute, i.e.voidclear()Removes all assigned values of this attribute.java.lang.ObjectgetValue(KeyedObject o)Return the value associated to the specified KeyedObject.java.lang.StringgetValueAsString(KeyedObject o)Return the attribute of the specified KeyedObject as a String.booleansetValue(T o, java.lang.Object value)Set the value of this attribute for the specified KeyedObject.-
Methods inherited from class ghidra.util.graph.attributes.Attribute
getModificationNumber, name, owningSet
-
-
-
-
Constructor Detail
-
ObjectAttribute
public ObjectAttribute(java.lang.String name, KeyIndexableSet<T> set)Constructor.- Parameters:
name- The name used to identify this attribute.set- The KeyIndexableSet whose elements can be assigned a value within this attribute.
-
-
Method Detail
-
setValue
public boolean setValue(T o, java.lang.Object value)
Set the value of this attribute for the specified KeyedObject.- Parameters:
o- The KeyedObject that is assigned the value. Should be a member of the owningSet.value- The value to associate with the specified KeyedObject.- Returns:
- true if the value could be set. Return false if o is not a member of the owningSet.
-
getValue
public java.lang.Object getValue(KeyedObject o)
Return the value associated to the specified KeyedObject.- Throws:
NoValueException- if the value has not been set or the KeyedObject does not belong to the owningSet.
-
attributeType
public java.lang.String attributeType()
Return the type of Attribute, i.e. what kind of values does this attribute hold. "Long", "Object", "Double" are examples.- Specified by:
attributeTypein classAttribute<T extends KeyedObject>
-
clear
public void clear()
Removes all assigned values of this attribute.- Specified by:
clearin classAttribute<T extends KeyedObject>
-
getValueAsString
public java.lang.String getValueAsString(KeyedObject o)
Return the attribute of the specified KeyedObject as a String.- Specified by:
getValueAsStringin classAttribute<T extends KeyedObject>
-
-