Package de.xima.fc.common.tree
Class TreeVisit.ITreeVisitor.Pathless<Node>
- java.lang.Object
-
- de.xima.fc.common.tree.TreeVisit.ITreeVisitor.Pathless<Node>
-
- Type Parameters:
Node
- Type of the tree nodes.
- All Implemented Interfaces:
TreeVisit.ITreeVisitor<Node>
- Enclosing interface:
- TreeVisit.ITreeVisitor<Node>
public abstract static class TreeVisit.ITreeVisitor.Pathless<Node> extends Object implements TreeVisit.ITreeVisitor<Node>
A convenientTreeVisit.ITreeVisitor
with apath
parameter for the methods. useful if you do not need it.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.xima.fc.common.tree.TreeVisit.ITreeVisitor
TreeVisit.ITreeVisitor.Pathless<Node>
-
-
Constructor Summary
Constructors Constructor Description Pathless()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TreeVisit.ETreeVisitResult
enter(Node node)
Enters a tree node.TreeVisit.ETreeVisitResult
enter(Node node, List<TreeVisit.TreePathFragment<Node>> path)
Enters a tree node.protected boolean
exit(Node node)
Exists a tree node.boolean
exit(Node node, List<TreeVisit.TreePathFragment<Node>> path)
Exists a tree node.protected boolean
visit(Node node)
Visits a tree node.boolean
visit(Node node, List<TreeVisit.TreePathFragment<Node>> path)
Visits a tree node.
-
-
-
Method Detail
-
enter
public final TreeVisit.ETreeVisitResult enter(Node node, List<TreeVisit.TreePathFragment<Node>> path)
Description copied from interface:TreeVisit.ITreeVisitor
Enters a tree node. This is called when the node is first reached, before any visitor methods are called on child nodes. SeeTreeVisit
for an example of the call order.- Specified by:
enter
in interfaceTreeVisit.ITreeVisitor<Node>
- Parameters:
node
- A tree node.path
- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePath
is set tofalse
- Returns:
- How to proceed with the tree visit.
-
exit
public final boolean exit(Node node, List<TreeVisit.TreePathFragment<Node>> path)
Description copied from interface:TreeVisit.ITreeVisitor
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. SeeTreeVisit
for an example of the call order.- Specified by:
exit
in interfaceTreeVisit.ITreeVisitor<Node>
- Parameters:
node
- A tree node.path
- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePath
is set tofalse
- Returns:
true
to continue with the tree visit,false
to exit the visit (seeTreeVisit.ETreeVisitResult.QUIT
).
-
visit
public final boolean visit(Node node, List<TreeVisit.TreePathFragment<Node>> path)
Description copied from interface:TreeVisit.ITreeVisitor
Visits a tree node. This is called betweenenter
andexit
. SeeTreeVisit
for an example of the call order.- Specified by:
visit
in interfaceTreeVisit.ITreeVisitor<Node>
- Parameters:
node
- A tree node.path
- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePath
is set tofalse
- Returns:
true
to continue with the tree visit,false
to exit the visit (seeTreeVisit.ETreeVisitResult.QUIT
).
-
enter
protected TreeVisit.ETreeVisitResult enter(Node node)
Enters a tree node. This is called when the node is first reached, before any visitor methods are called on child nodes. SeeTreeVisit
for an example of the call order.- Parameters:
node
- A tree node.- Returns:
- How to proceed with the tree visit.
-
exit
protected boolean exit(Node node)
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. SeeTreeVisit
for an example of the call order.- Parameters:
node
- A tree node.- Returns:
true
to continue with the tree visit,false
to exit the visit (seeTreeVisit.ETreeVisitResult.QUIT
).
-
visit
protected boolean visit(Node node)
Visits a tree node. This is called betweenenter
andexit
. SeeTreeVisit
for an example of the call order.- Parameters:
node
- A tree node.- Returns:
true
to continue with the tree visit,false
to exit the visit (seeTreeVisit.ETreeVisitResult.QUIT
).
-
-