public abstract class DFSFinishTimeIterator<T> extends Stack<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.capacityIncrement, elementCount, elementDatamodCount| 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, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizefinalize, getClass, notify, notifyAll, wait, wait, waitforEachRemainingparallelStream, streamprotected void init(Graph<T> G, Iterator<? extends T> nodes)
G - 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>UnimplementedErrorIterator.remove()