public class DFSPathFinder<T> extends Stack<T>
Modifier and Type | Field and Description |
---|---|
protected Graph<T> |
G
The graph to search
|
protected Map<Object,Iterator<? extends T>> |
pendingChildren
An iterator of child nodes for each node being searched
|
static long |
serialVersionUID |
capacityIncrement, elementCount, elementData
modCount
Constructor and Description |
---|
DFSPathFinder(Graph<T> G,
Iterator<T> nodes,
Predicate<T> f)
Construct a depth-first enumerator across the (possibly improper) subset of nodes reachable from the nodes in the given
enumeration.
|
DFSPathFinder(Graph<T> G,
T N,
Predicate<T> f)
Construct a depth-first enumerator starting with a particular node in a directed graph.
|
Modifier and Type | Method and Description |
---|---|
protected List<T> |
currentPath() |
List<T> |
find() |
protected Iterator<? extends T> |
getConnected(T n)
get the out edges of a given node
|
protected Iterator<? extends T> |
getPendingChildren(T n)
Method getPendingChildren.
|
boolean |
hasNext()
Return whether there are any more nodes left to enumerate.
|
protected void |
setPendingChildren(T v,
Iterator<? extends T> iterator)
Method setPendingChildren.
|
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
parallelStream, stream
public static final long serialVersionUID
public DFSPathFinder(Graph<T> G, T N, Predicate<T> f) throws IllegalArgumentException
G
- the graph whose nodes to enumerateIllegalArgumentException
- if G is nullpublic List<T> find()
public boolean hasNext()
protected Iterator<? extends T> getPendingChildren(T n)
protected void setPendingChildren(T v, Iterator<? extends T> iterator)
v
- iterator
-