Class NodeCalcVisitors


  • public final class NodeCalcVisitors
    extends Object
    This utility class implements the core iterative algorithm to perform a post-order NodeCalc tree traversal using a NodeCalcVisitor.
    Author:
    Jon Harper
    • 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 of 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.

        Parameters:
        root - The NodeCalc tree
        arg - an optional argument
        visitor - The NodeCalcVisitor
        Returns:
        network factory with the given name