wt.visitor
Class DFSWalker

java.lang.Object
  extended bywt.visitor.BasicWalker
      extended bywt.visitor.Navigator
          extended bywt.visitor.DFSWalker
All Implemented Interfaces:
Walker
Direct Known Subclasses:
DFSNavigator

public class DFSWalker
extends Navigator

This class extends BasicWalker to implement a depth-first traversal of a structure. As each node is traversed, the visit methods are called on the Visitor object, the node is expanded, and the traverse method is called recursively on all of the expanded nodes. Note that during this depth first traversal, the parent nodes are always visited before the children nodes.

Supported API: true

Extendable: false


Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
 
Fields inherited from class wt.visitor.BasicWalker
 
Fields inherited from interface wt.visitor.Walker
NODE_EXPANDER, VISITOR
 
Constructor Summary
DFSWalker()
           
 
Method Summary
 void traverse(Persistable root)
          Traverses the root node using a depth first search.
private  void traverse(Persistable fromNode, Link link, Persistable toNode, PathNode toPathNode, int level)
          Traverses the root node using a depth first search.
 
Methods inherited from class wt.visitor.BasicWalker
clearVisitedNodes, getNodeExpander, getVisitor, isRecursionDetectionEnabled, registerVisitedNode, setNodeExpander, setRecursionDetectionEnabled, setVisitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Constructor Detail

DFSWalker

public DFSWalker()
Method Detail

traverse

public void traverse(Persistable root)
              throws WTException
Traverses the root node using a depth first search.

Supported API: true

Parameters:
root -
Throws:
WTException

traverse

private void traverse(Persistable fromNode,
                      Link link,
                      Persistable toNode,
                      PathNode toPathNode,
                      int level)
               throws WTException
Traverses the root node using a depth first search. This method vists the node, expands the node, and then calls itself recursively on each child node.

Supported API: false

Parameters:
fromNode - parent node
link - link to parent node
toNode - current node
Throws:
WTException