Class Attribute<T extends KeyedObject>

java.lang.Object
ghidra.util.graph.attributes.Attribute<T>
Direct Known Subclasses:
DoubleAttribute, IntegerAttribute, LongAttribute, ObjectAttribute, StringAttribute

public abstract class Attribute<T extends KeyedObject> extends Object
Base class for attributes -- int, double, or String values -- which can be assigned to the members of a KeyIndexableSet, e.g. the vertices or edges of a DirectedGraph. The attributes do not track changes in the owning set, but you can check if the owning set has been modified since creation time. It is possible to create an attribute on the vertex set and then remove the vertex from the graph. An attempt to get the value associated with that vertex will cause a NoValueException to be thrown.
  • Constructor Details

    • Attribute

      public Attribute(String name, KeyIndexableSet<T> set)
      Constructor
      Parameters:
      name - name of the attribute
      set - set whose members may have attribute values defined
  • Method Details

    • getModificationNumber

      public long getModificationNumber()
      Return the current value of the modificationNumber which counts the number of changes this Attribute has undergone.
    • name

      public String name()
      Return the name of this Attribute.
    • owningSet

      public KeyIndexableSet<T> owningSet()
      Return the KeyIndexableSet, typically a VertexSet or EdgeSet, that this attribute is defined for. An attribute value can only be set for a KeyedObject if it is a member of the owningSet.
    • attributeType

      public abstract String attributeType()
      Return the type of Attribute, i.e. what kind of values does this attribute hold. "Long", "Object", "Double" are examples.
    • getValueAsString

      public abstract String getValueAsString(KeyedObject o)
      Return the attribute of the specified KeyedObject as a String.
    • clear

      public abstract void clear()
      Undefine all values set for this attribute.