public abstract class DFSDiscoverTimeIterator<T> extends Stack<T> implements Iterator<T>
NumberedGraph
, return an enumeration of the nodes of the graph in order of
increasing discover 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, elementData
modCount
Constructor and Description |
---|
DFSDiscoverTimeIterator() |
Modifier and Type | Method and Description |
---|---|
protected abstract Iterator<? extends T> |
getConnected(T n)
get the out edges of a given node
|
protected abstract Iterator<? extends T> |
getPendingChildren(T n) |
boolean |
hasNext()
Return whether there are any more nodes left to enumerate.
|
protected void |
init(Iterator<? extends T> nodes)
subclass constructors must call this!
|
protected void |
init(T N)
subclass constructors must call this!
|
T |
next()
Find the next graph node in discover time order.
|
void |
remove() |
protected abstract void |
setPendingChildren(T v,
Iterator<? extends T> iterator) |
protected void |
visitEdge(T from,
T to) |
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, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
forEachRemaining
parallelStream, stream
protected void init(T N)
public boolean hasNext()
public T next() throws NoSuchElementException
next
in interface Iterator<T>
NoSuchElementException
protected abstract Iterator<? extends T> getConnected(T n)
n
- the node of which to get the out edgespublic void remove() throws UnimplementedError
remove
in interface Iterator<T>
UnimplementedError