Class AbstractPostOrderTraversalVisitor<T>
java.lang.Object
io.openml.gearbox.algorithms.binarytree.AbstractPostOrderTraversalVisitor<T>
- Type Parameters:
T- The type of value wrapped in theVisitableobject to be visited by this visitor. For example, if the visitable class isImmutableTreeNode, then the type of value is the return type of itsImmutableTreeNode.getValue()method
- All Implemented Interfaces:
Visitor<T>
An abstract
Visitor that performs an iterative post-order traversal (Left, Right, Root).
This class follows the "combined" visitor model where the traversal logic is bundled inside the visitor for
convenience. It uses the Template Method pattern, requiring subclasses to implement the
processNode(TreeNode) method to define the action taken on each node.
For a detailed discussion of the architectural trade-offs between this combined approach and the more flexible,
separated approach, please see the Javadoc for AbstractInOrderTraversalVisitor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidprocessNode(TreeNode<T> node) An abstract method that defines the operation to be performed on each node during the traversal.voidvisit(ImmutableTreeNode<T> node) Visits anImmutableTreeNode.voidvisit(MutableTreeNode<T> node) Visits aMutableTreeNode.
-
Constructor Details
-
AbstractPostOrderTraversalVisitor
public AbstractPostOrderTraversalVisitor()
-
-
Method Details
-
processNode
-
visit
Description copied from interface:VisitorVisits anImmutableTreeNode. -
visit
Description copied from interface:VisitorVisits aMutableTreeNode.
-