V - Vertex typeE - Edge typepublic class DepthFirstIterator<V,E extends DefaultEdge> extends Object implements Iterator<V>
| Constructor and Description |
|---|
DepthFirstIterator(DirectedGraph<V,E> graph,
V start) |
| Modifier and Type | Method and Description |
|---|---|
private static <V,E extends DefaultEdge> |
buildList(DirectedGraph<V,E> graph,
V start) |
private static <V,E extends DefaultEdge> |
buildListRecurse(Collection<V> list,
Set<V> activeVertices,
DirectedGraph<V,E> graph,
V start) |
boolean |
hasNext() |
V |
next() |
static <V,E extends DefaultEdge> |
of(DirectedGraph<V,E> graph,
V start)
Creates an iterable over the vertices in the given graph in a depth-first
iteration order.
|
static <V,E extends DefaultEdge> |
reachable(Collection<V> list,
DirectedGraph<V,E> graph,
V start)
Populates a collection with the nodes reachable from a given node.
|
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic DepthFirstIterator(DirectedGraph<V,E> graph, V start)
private static <V,E extends DefaultEdge> List<V> buildList(DirectedGraph<V,E> graph, V start)
public static <V,E extends DefaultEdge> Iterable<V> of(DirectedGraph<V,E> graph, V start)
public static <V,E extends DefaultEdge> void reachable(Collection<V> list, DirectedGraph<V,E> graph, V start)
private static <V,E extends DefaultEdge> void buildListRecurse(Collection<V> list, Set<V> activeVertices, DirectedGraph<V,E> graph, V start)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.