Package com.powsybl.timeseries.ast
Class NodeCalcVisitors
- java.lang.Object
-
- com.powsybl.timeseries.ast.NodeCalcVisitors
-
public final class NodeCalcVisitors extends Object
This utility class implements the core iterative algorithm to perform a post-orderNodeCalc
tree traversal using aNodeCalcVisitor
.- Author:
- Jon Harper
-
-
Field Summary
Fields Modifier and Type Field Description static Object
NULL
static int
RECURSION_THRESHOLD
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R,A>
Rvisit(NodeCalc root, A arg, NodeCalcVisitor<R,A> visitor)
Perform the post-order tree traversal ofroot
usingvisitor
.
-
-
-
Field Detail
-
RECURSION_THRESHOLD
public static final int RECURSION_THRESHOLD
-
NULL
public static final Object NULL
-
-
Method Detail
-
visit
public static <R,A> R visit(NodeCalc root, A arg, NodeCalcVisitor<R,A> visitor)
Perform the post-order tree traversal ofroot
usingvisitor
. The argumentarg
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.
- Parameters:
root
- The NodeCalc treearg
- an optional argumentvisitor
- The NodeCalcVisitor- Returns:
- network factory with the given name
-
-