Module gen.tree
Class BaseTreeNodeVisitorHandlerExtensions
java.lang.Object
io.github.astrapi69.gen.tree.handler.BaseTreeNodeVisitorHandlerExtensions
The class
BaseTreeNodeVisitorHandlerExtensions
provides handler methods for the visit all
field in the class IBaseTreeNode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V,
K, T extends IBaseTreeNode<V, K, T>>
voidaccept
(T treeNode, @NonNull io.github.astrapi69.design.pattern.visitor.Visitor<T> visitor) Accepts the given visitor that provides a custom algorithm for processing all elementsstatic <V,
K, T extends IBaseTreeNode<V, K, T>>
voidaccept
(T treeNode, @NonNull io.github.astrapi69.design.pattern.visitor.Visitor<T> visitor, boolean visitBefore) Accepts the given visitor that provides a custom algorithm for processing all elementsstatic <V,
K, T extends IBaseTreeNode<V, K, T>>
Collection<T>traverse
(T treeNode) Traverse the givenIBaseTreeNode
object and add all descendants with the givenIBaseTreeNode
object included in to the returnedCollection
object
-
Constructor Details
-
BaseTreeNodeVisitorHandlerExtensions
public BaseTreeNodeVisitorHandlerExtensions()
-
-
Method Details
-
traverse
Traverse the givenIBaseTreeNode
object and add all descendants with the givenIBaseTreeNode
object included in to the returnedCollection
object- Type Parameters:
V
- the generic type of the valueK
- the generic type of the id of the nodeT
- the generic type of the concrete tree node- Parameters:
treeNode
- the tree node- Returns:
- a
Collection
object with the givenIBaseTreeNode
object and add all descendants
-
accept
public static <V,K, void acceptT extends IBaseTreeNode<V, K, T>> (@NonNull T treeNode, @NonNull @NonNull io.github.astrapi69.design.pattern.visitor.Visitor<T> visitor) Accepts the given visitor that provides a custom algorithm for processing all elements- Type Parameters:
V
- the generic type of the valueK
- the generic type of the id of the nodeT
- the generic type of the concrete tree node- Parameters:
treeNode
- the tree nodevisitor
- the visitor
-
accept
public static <V,K, void acceptT extends IBaseTreeNode<V, K, T>> (@NonNull T treeNode, @NonNull @NonNull io.github.astrapi69.design.pattern.visitor.Visitor<T> visitor, boolean visitBefore) Accepts the given visitor that provides a custom algorithm for processing all elements- Type Parameters:
V
- the generic type of the valueK
- the generic type of the id of the nodeT
- the generic type of the concrete tree node- Parameters:
treeNode
- the tree nodevisitor
- the visitorvisitBefore
- the flag if this flag is true the visit of the givenIBaseTreeNode
object is before visit the children otherwise the visit is after visit the children
-