Class BFSIterator<T>
java.lang.Object
com.ibm.wala.util.graph.traverse.BFSIterator<T>
- All Implemented Interfaces:
Iterator<T>
This class implements breadth-first search over a Graph, returning an Iterator of the nodes of
the graph in order of discovery. This class follows the outNodes of the graph nodes to define the
graph, but this behavior can be changed by overriding the getConnected method.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBFSIterator
(Graph<T> G) Constructor DFSFinishTimeIterator.BFSIterator
(Graph<T> G, @Nullable Iterator<? extends T> nodes) Construct a breadth-first enumerator across the (possibly improper) subset of nodes reachable from the nodes in the given enumeration.BFSIterator
(Graph<T> G, T N) Construct a breadth-first iterator starting with a particular node in a directed graph. -
Method Summary
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
-
Field Details
-
G
-
-
Constructor Details
-
BFSIterator
Construct a breadth-first iterator starting with a particular node in a directed graph.- Parameters:
G
- the graph whose nodes to enumerate- Throws:
IllegalArgumentException
- if G is null
-
BFSIterator
Construct a breadth-first enumerator across the (possibly improper) subset of nodes reachable from the nodes in the given enumeration.- Parameters:
nodes
- the set of nodes from which to start searching- Throws:
IllegalArgumentException
- if G is null
-
BFSIterator
Constructor DFSFinishTimeIterator.- Throws:
NullPointerException
- if G is null
-
-
Method Details
-
hasNext
-
next
Find the next graph node in discover time order.- Specified by:
next
in interfaceIterator<T>
- Returns:
- the next graph node in discover time order.
- Throws:
NoSuchElementException
-
getConnected
-
remove
- Specified by:
remove
in interfaceIterator<T>
- Throws:
UnimplementedError
-