|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javaslam.tjt.graph.Traversal
|
+--javaslam.tjt.graph.BreadthFirstTraversal
An iterator that traverses the nodes of a graph in breadth-first (siblings before children) order.
| Field Summary | |
protected LinkedList |
queue
A queue of nodes to be visited in this search. |
| Fields inherited from class javaslam.tjt.graph.Traversal |
current, cycle, edges |
| Constructor Summary | |
BreadthFirstTraversal(Node n)
Constructor. |
|
| Method Summary | |
protected Node |
dequeue()
Dequeues a node to visit. |
protected void |
enqueue(Node n)
Enqueues a node for later visit. |
boolean |
hasNext()
Returns true if the iteration has more elements. |
| Methods inherited from class javaslam.tjt.graph.Traversal |
current, edge, isCyclic, next, path, size |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected LinkedList queue
| Constructor Detail |
public BreadthFirstTraversal(Node n)
n - the node from which to start the traversal; this will be
the first node returned by the iterator| Method Detail |
public boolean hasNext()
true if the iteration has more elements.
(In other words, returns true if next would return an element
rather than throwing an exception.)
hasNext in class Traversalprotected void enqueue(Node n)
enqueue in class Traversalprotected Node dequeue()
dequeue in class Traversal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||