|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.util.graph.traverse.BFSIterator<T>
public class BFSIterator<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 | |
|---|---|
protected Graph<T> |
G
Governing Graph |
| Constructor Summary | |
|---|---|
BFSIterator(Graph<T> G)
Constructor DFSFinishTimeIterator. |
|
BFSIterator(Graph<T> G,
java.util.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 | |
|---|---|
protected java.util.Iterator<? extends T> |
getConnected(T n)
get the out edges of a given node |
boolean |
hasNext()
Return whether there are any more nodes left to enumerate. |
T |
next()
Find the next graph node in discover time order. |
void |
remove()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Graph<T> G
| Constructor Detail |
|---|
public BFSIterator(Graph<T> G,
T N)
G - the graph whose nodes to enumerate
java.lang.IllegalArgumentException - if G is null
public BFSIterator(Graph<T> G,
java.util.Iterator<? extends T> nodes)
nodes - the set of nodes from which to start searching
java.lang.IllegalArgumentException - if G is null
public BFSIterator(Graph<T> G)
throws java.lang.NullPointerException
G -
java.lang.NullPointerException - if G is null| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iterator<T>
public T next()
throws java.util.NoSuchElementException
next in interface java.util.Iterator<T>java.util.NoSuchElementExceptionprotected java.util.Iterator<? extends T> getConnected(T n)
n - the node of which to get the out edges
public void remove()
throws UnimplementedError
remove in interface java.util.Iterator<T>UnimplementedErrorIterator.remove()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||