public abstract class TreeVisitor extends Object
Constructor and Description |
---|
TreeVisitor() |
Modifier and Type | Method and Description |
---|---|
abstract void |
process(Node node)
Process the given node.
|
void |
visitBreadthFirst(Node node)
https://en.wikipedia.org/wiki/Breadth-first_search
|
void |
visitDirectChildren(Node node)
Performs a simple traversal over all nodes that have the passed node as their parent.
|
void |
visitLeavesFirst(Node node) |
void |
visitPostOrder(Node node)
Performs a post-order node traversal starting with a given node.
|
void |
visitPreOrder(Node node)
Performs a pre-order node traversal starting with a given node.
|
public void visitLeavesFirst(Node node)
public void visitPreOrder(Node node)
process(Node)
is called for further processing.node
- The node at which the traversal begins.public void visitPostOrder(Node node)
process(Node)
is called for further processing.node
- The node at which the traversal begins.public void visitBreadthFirst(Node node)
node
- the start node, and the first one that is passed to process(node).public abstract void process(Node node)
node
- The current node to process.public void visitDirectChildren(Node node)
Copyright © 2007–2019. All rights reserved.