Package org.apache.calcite.util.graph
Class BreadthFirstIterator<V,E extends DefaultEdge>
java.lang.Object
org.apache.calcite.util.graph.BreadthFirstIterator<V,E>
- Type Parameters:
V
- Vertex typeE
- Edge type
- All Implemented Interfaces:
Iterator<V>
Iterates over the vertices in a directed graph in breadth-first order.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
next()
static <V,
E extends DefaultEdge>
Iterable<V>of
(DirectedGraph<V, E> graph, V root) static <V,
E extends DefaultEdge>
voidreachable
(Set<V> set, DirectedGraph<V, E> graph, V root) Populates a set with the nodes reachable from a given node.void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
BreadthFirstIterator
-
-
Method Details
-
of
-
reachable
public static <V,E extends DefaultEdge> void reachable(Set<V> set, DirectedGraph<V, E> graph, V root) Populates a set with the nodes reachable from a given node. -
hasNext
public boolean hasNext() -
next
-
remove
public void remove()
-