XML Parser for Java 1.1.16

com.ibm.xml.parser
Class NonRecursivePreorderTreeTraversal

java.lang.Object
  |
  +--com.ibm.xml.parser.TreeTraversal
        |
        +--com.ibm.xml.parser.NonRecursivePreorderTreeTraversal

public class NonRecursivePreorderTreeTraversal
extends TreeTraversal

NonRecursivePreorderTreeTraversal defines a specific document object tree traversal algorithm for use by the visitor design pattern. This algorithm visits the Parent before visiting its children.

Version:
Revision: %M% %I% %W% %Q%
See Also:
TreeTraversal, RecursivePreorderTreeTraversal

Constructor Summary
NonRecursivePreorderTreeTraversal(Visitor visitor)
          Constructor.
 
Method Summary
 void traverse(Node startNode)
          Traverses the document object tree at the specified startNode.
 
Methods inherited from class com.ibm.xml.parser.TreeTraversal
getVisitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonRecursivePreorderTreeTraversal

public NonRecursivePreorderTreeTraversal(Visitor visitor)
Constructor.
Parameters:
visitor - The implemention of the Visitor operation (toXMLString, digest, ...)
See Also:
Visitor
Method Detail

traverse

public void traverse(Node startNode)
              throws java.lang.Exception
Traverses the document object tree at the specified startNode.

The numbered nodes in the trees below indicate the order of traversal given the specified startNode of "1".


                 1              x              x
                / \            / \            / \
               2   6          1   x          x   x
              /|\   \        /|\   \        /|\   \
             3 4 5   7      2 3 4   x      x 1 x   x

 
Parameters:
startNode - The starting point to begin traversing the document object tree.
Throws:
java.lang.Exception - Thrown if the document hierarchy can not be visitted.
Overrides:
traverse in class TreeTraversal

XML Parser for Java 1.1.16