Interface TreeVisit.ITreeVisitor<Node>
- Type Parameters:
Node- Type of the tree nodes.
- All Known Implementing Classes:
FindPositionVisitor, TreeVisit.ITreeVisitor.Pathless, ValueDescriptorNodeVisitor
- Enclosing class:
TreeVisit
public static interface TreeVisit.ITreeVisitor<Node>
Visitor for a tree data structure.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA convenientTreeVisit.ITreeVisitorwith apathparameter for the methods. useful if you do not need it. -
Method Summary
Modifier and TypeMethodDescriptiondefault TreeVisit.ETreeVisitResultenter(Node node, List<TreeVisit.TreePathFragment<Node>> path) Enters a tree node.default booleanexit(Node node, List<TreeVisit.TreePathFragment<Node>> path) Exists a tree node.default booleanvisit(Node node, List<TreeVisit.TreePathFragment<Node>> path) Visits a tree node.
-
Method Details
-
enter
Enters a tree node. This is called when the node is first reached, before any visitor methods are called on child nodes. SeeTreeVisitfor an example of the call order.- Parameters:
node- A tree node.path- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePathis set tofalse- Returns:
- How to proceed with the tree visit.
-
exit
Exists a tree node. This is called at the end, after all children were visited. No more visitor methods will be called on any children of the node. SeeTreeVisitfor an example of the call order.- Parameters:
node- A tree node.path- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePathis set tofalse- Returns:
trueto continue with the tree visit,falseto exit the visit (seeTreeVisit.ETreeVisitResult.QUIT).
-
visit
Visits a tree node. This is called betweenenterandexit. SeeTreeVisitfor an example of the call order.- Parameters:
node- A tree node.path- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePathis set tofalse- Returns:
trueto continue with the tree visit,falseto exit the visit (seeTreeVisit.ETreeVisitResult.QUIT).
-