public final class NodeCalcVisitors
extends java.lang.Object
NodeCalc
tree traversal using a
NodeCalcVisitor
.Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
NULL |
static int |
RECURSION_THRESHOLD |
Modifier and Type | Method and Description |
---|---|
static <R,A> R |
visit(NodeCalc root,
A arg,
NodeCalcVisitor<R,A> visitor)
Perform the post-order tree traversal of
root using visitor . |
public static final int RECURSION_THRESHOLD
public static final java.lang.Object NULL
public static <R,A> R visit(NodeCalc root, A arg, NodeCalcVisitor<R,A> visitor)
root
using visitor
.
The argument arg
is supplied to the visitors at each visit of a node.
For each node, the iterate method is first called to traverse the tree. Then, after all the children have been visited, the visit method is called with the result of visiting all the children.
root
- The NodeCalc treearg
- an optional argumentvisitor
- The NodeCalcVisitorCopyright © 2020. All rights reserved.