Interface KeyIndexableSet<T extends KeyedObject>


  • public interface KeyIndexableSet<T extends KeyedObject>
    Interface for sets of graph objects which have keys such as vertices and edges.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean add​(T o)
      Adds a KeyedObject to this KeyIndexableSet.
      int capacity()
      Returns the number of KeyedObjects this KeyIndexableSet can hold without growing.
      boolean contains​(T o)
      Returns true if this KeyIndexableSet contains the specified KeyedObject.
      T getKeyedObject​(long key)
      Returns the KeyedObject with the specified key in this KeyIndexableSet.
      long getModificationNumber()
      The modification number is a counter for the number of changes the KeyIndexableSet has undergone since its creation.
      GraphIterator<T> iterator()
      Returns an iterator for this KeyIndexableSet which uses the hasNext()/next() style.
      boolean remove​(T o)
      Remove a KeyedObject from this KeyIndexableSet.
      int size()
      Returns the number of KeyedObjects in this KeyIndexableSet
      T[] toArray()
      Returns the elements of this KeyIndexableSet as an array of KeyedObjects.
    • Method Detail

      • getModificationNumber

        long getModificationNumber()
        The modification number is a counter for the number of changes the KeyIndexableSet has undergone since its creation.
      • size

        int size()
        Returns the number of KeyedObjects in this KeyIndexableSet
      • capacity

        int capacity()
        Returns the number of KeyedObjects this KeyIndexableSet can hold without growing.
      • add

        boolean add​(T o)
        Adds a KeyedObject to this KeyIndexableSet. The set will increase in capacity if needed.
        Returns:
        true if the KeyedObject was successfully added. Returns false if the KeyedObject is null or already in the KeyIndexableSet or addition fails for some other reason.
      • remove

        boolean remove​(T o)
        Remove a KeyedObject from this KeyIndexableSet.
        Returns:
        true if the KeyedObject was sucessfully removed. Returns false if the KeyedObject was not in the KeyIndexablrSet.
      • contains

        boolean contains​(T o)
        Returns true if this KeyIndexableSet contains the specified KeyedObject.
      • iterator

        GraphIterator<T> iterator()
        Returns an iterator for this KeyIndexableSet which uses the hasNext()/next() style. See GraphIterator.
      • toArray

        T[] toArray()
        Returns the elements of this KeyIndexableSet as an array of KeyedObjects.
      • getKeyedObject

        T getKeyedObject​(long key)
        Returns the KeyedObject with the specified key in this KeyIndexableSet. Returns null if the Set contains no object with that key.