public abstract class DFSFinishTimeIterator<T> extends ArrayList<T> implements Iterator<T>
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.modCount| Constructor and Description |
|---|
DFSFinishTimeIterator() |
| Modifier and Type | Method and Description |
|---|---|
protected Iterator<T> |
getConnected(T n)
get the out edges of a given node
|
boolean |
hasNext()
Return whether there are any more nodes left to enumerate.
|
protected void |
init(Graph<T> G,
Iterator<? extends T> nodes)
Subclasses must call this in the constructor!
|
T |
next()
Find the next graph node in finishing time order.
|
void |
remove() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitforEachRemainingcontainsAll, equals, hashCodeparallelStream, streamprotected void init(Graph<T> G, Iterator<? extends T> nodes)
public boolean hasNext()
public T next() throws NoSuchElementException
next in interface Iterator<T>NoSuchElementExceptionprotected Iterator<T> getConnected(T n)
n - the node of which to get the out edgespublic void remove()
throws UnimplementedError
remove in interface Iterator<T>UnimplementedError