|
||||||||||
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.DepthFirstTraversal
An iterator that traverses the nodes of a graph in depth-first (children before siblings) 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 | |
DepthFirstTraversal(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 DepthFirstTraversal(Node n)
n
- the node from which to start the traversal; this will be
the first node returned by the iteratorMethod 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 Traversal
protected void enqueue(Node n)
enqueue
in class Traversal
protected Node dequeue()
dequeue
in class Traversal
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |