org.apache.jdo.jdoql.tree

Class TreeWalker

    • Constructor Summary

      Constructors 
      Constructor and Description
      TreeWalker() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Object walk(Node node, NodeVisitor visitor)
      Walks the tree specified by the argument node implementing a depth first algorithm.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TreeWalker

        public TreeWalker()
    • Method Detail

      • walk

        public java.lang.Object walk(Node node,
                            NodeVisitor visitor)
        Walks the tree specified by the argument node implementing a depth first algorithm. Executes the visitor instance callback arrive when starting to walk the argument node. Subsequently iterates that node's children and executes the visitor instance callback walkNextChild before the current child is walked. For the case that walkNextChild returns true, this tree walker walkes the next child. Otherwise, the next child and all remaining childs are not walked. In both cases, this tree walker executes the visitor instance callback leave indicating that the argument node and its children have been walked. The result of leave is returned. when starting to traverse a node.
        Parameters:
        node - the tree instance
        visitor - the node visitor instance
        Returns:
        the object returned by the visitor instance callback leave

Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.