Class DFSFinishTimeIterator<T>

java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
com.ibm.wala.util.graph.traverse.DFSFinishTimeIterator<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, Iterator<T>, List<T>, RandomAccess, SequencedCollection<T>
Direct Known Subclasses:
NumberedDFSFinishTimeIterator, SlowDFSFinishTimeIterator

public abstract class DFSFinishTimeIterator<T> extends ArrayList<T> implements Iterator<T>
This class implements depth-first search over a Graph, return an enumeration of the nodes of the graph in order of increasing finishing time. This class follows the outNodes of the graph nodes to define the graph, but this behavior can be changed by overriding the getConnected method.
See Also:
  • Constructor Details

    • DFSFinishTimeIterator

      public DFSFinishTimeIterator()
  • Method Details

    • init

      protected void init(Graph<T> G, Iterator<? extends T> nodes)
      Subclasses must call this in the constructor!
    • hasNext

      public boolean hasNext()
      Return whether there are any more nodes left to enumerate.
      Specified by:
      hasNext in interface Iterator<T>
      Returns:
      true if there nodes left to enumerate.
    • next

      public @Nullable T next() throws NoSuchElementException
      Find the next graph node in finishing time order.
      Specified by:
      next in interface Iterator<T>
      Returns:
      the next graph node in finishing time order.
      Throws:
      NoSuchElementException
    • getConnected

      protected Iterator<T> getConnected(@Nullable T n)
      get the out edges of a given node
      Parameters:
      n - the node of which to get the out edges
      Returns:
      the out edges
    • remove

      public void remove() throws UnimplementedError
      Specified by:
      remove in interface Iterator<T>
      Throws:
      UnimplementedError