Class IncrementalImmutableSequentialGraph

All Implemented Interfaces:
FlyweightPrototype<ImmutableGraph>

public class IncrementalImmutableSequentialGraph
extends ImmutableSequentialGraph
  • Field Details

    • END_OF_GRAPH

      public static long[][] END_OF_GRAPH
      A marker for the end of the graph.
  • Constructor Details

    • IncrementalImmutableSequentialGraph

      public IncrementalImmutableSequentialGraph()
  • Method Details

    • numNodes

      public long numNodes()
      Description copied from class: ImmutableGraph
      Returns the number of nodes of this graph.

      Albeit this method is not optional, it is allowed that this method throws an UnsupportedOperationException if this graph has never been entirely traversed using a node iterator. This apparently bizarre behaviour is necessary to support implementations as ArcListASCIIGraph, which do not know the actual number of nodes until a traversal has been completed.

      Specified by:
      numNodes in class ImmutableGraph
      Returns:
      the number of nodes.
    • nodeIterator

      public NodeIterator nodeIterator()
      Description copied from class: ImmutableGraph
      Returns a node iterator for scanning the graph sequentially, starting from the first node.
      Overrides:
      nodeIterator in class ImmutableGraph
      Returns:
      a NodeIterator for accessing nodes and successors sequentially.
    • add

      public void add​(long[][] successor, long offset, long length) throws InterruptedException
      Adds a new node having as successors contained in the specified big array fragment.

      The fragment must be sorted in increasing order.

      Parameters:
      successor - a big array.
      offset - the first valid entry in successor.
      length - the number of valid entries.
      Throws:
      InterruptedException
    • add

      public void add​(long[][] successor) throws InterruptedException
      Adds a new node having as successors contained in the specified big array.

      The array must be sorted in increasing order.

      Parameters:
      successor - a big array.
      Throws:
      InterruptedException
    • add

      public void add​(long[] successor, int offset, int length) throws InterruptedException
      Adds a new node having as successors contained in the specified array fragment.

      The fragment must be sorted in increasing order.

      Parameters:
      successor - an array.
      offset - the first valid entry in successor.
      length - the number of valid entries.
      Throws:
      InterruptedException
    • add

      public void add​(long[] successor) throws InterruptedException
      Adds a new node having as successors contained in the specified array.

      The array must be sorted in increasing order.

      Parameters:
      successor - an array.
      Throws:
      InterruptedException