Module gen.tree

Class BaseTreeNodeVisitorHandlerExtensions

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V,​K,​T extends IBaseTreeNode<V,​K,​T>>
      void
      accept​(T treeNode, @NonNull io.github.astrapi69.design.pattern.visitor.Visitor<T> visitor)
      Accepts the given visitor that provides a custom algorithm for processing all elements
      static <V,​K,​T extends IBaseTreeNode<V,​K,​T>>
      void
      accept​(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 elements
      static <V,​K,​T extends IBaseTreeNode<V,​K,​T>>
      java.util.Collection<T>
      traverse​(T treeNode)
      Traverse the given IBaseTreeNode object and add all descendants with the given IBaseTreeNode object included in to the returned Collection object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseTreeNodeVisitorHandlerExtensions

        public BaseTreeNodeVisitorHandlerExtensions()
    • Method Detail

      • traverse

        public static <V,​K,​T extends IBaseTreeNode<V,​K,​T>> java.util.Collection<T> traverse​(@NonNull
                                                                                                                    T treeNode)
        Traverse the given IBaseTreeNode object and add all descendants with the given IBaseTreeNode object included in to the returned Collection object
        Type Parameters:
        V - the generic type of the value
        K - the generic type of the id of the node
        T - the generic type of the concrete tree node
        Parameters:
        treeNode - the tree node
        Returns:
        a Collection object with the given IBaseTreeNode object and add all descendants
      • accept

        public static <V,​K,​T extends IBaseTreeNode<V,​K,​T>> void accept​(@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 value
        K - the generic type of the id of the node
        T - the generic type of the concrete tree node
        Parameters:
        treeNode - the tree node
        visitor - the visitor
      • accept

        public static <V,​K,​T extends IBaseTreeNode<V,​K,​T>> void accept​(@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 value
        K - the generic type of the id of the node
        T - the generic type of the concrete tree node
        Parameters:
        treeNode - the tree node
        visitor - the visitor
        visitBefore - the flag if this flag is true the visit of the given IBaseTreeNode object is before visit the children otherwise the visit is after visit the children