Class Attribute<T extends KeyedObject>

  • Direct Known Subclasses:
    DoubleAttribute, IntegerAttribute, LongAttribute, ObjectAttribute, StringAttribute

    public abstract class Attribute<T extends KeyedObject>
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      Attribute​(java.lang.String name, KeyIndexableSet<T> set)
      Constructor
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String attributeType()
      Return the type of Attribute, i.e.
      abstract void clear()
      Undefine all values set for this attribute.
      long getModificationNumber()
      Return the current value of the modificationNumber which counts the number of changes this Attribute has undergone.
      abstract java.lang.String getValueAsString​(KeyedObject o)
      Return the attribute of the specified KeyedObject as a String.
      java.lang.String name()
      Return the name of this Attribute.
      KeyIndexableSet<T> owningSet()
      Return the KeyIndexableSet, typically a VertexSet or EdgeSet, that this attribute is defined for.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Attribute

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

      • getModificationNumber

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

        public java.lang.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 java.lang.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 java.lang.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.