Module gen.tree

Class IBaseTreeNodeHandlerExtensions

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V,​K,​T extends IBaseTreeNode<V,​K,​T>>
      T
      findById​(T treeNode, K id)
      Find the occurrence of IBaseTreeNode object from the given key object that serves as the search target
      static <V,​K,​T extends IBaseTreeNode<V,​K,​T>>
      T
      mergeTreeNodes​(T root, @NonNull java.util.List<T> treeNodes)
      Merge the given tree nodes with the given root tree node
      static <V,​K,​T extends IBaseTreeNode<V,​K,​T>>
      T
      mergeTreeNodes​(T root, T... treeNodes)
      Merge the given tree nodes with the given root tree node
      • Methods inherited from class java.lang.Object

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

      • IBaseTreeNodeHandlerExtensions

        public IBaseTreeNodeHandlerExtensions()
    • Method Detail

      • findById

        public static <V,​K,​T extends IBaseTreeNode<V,​K,​T>> T findById​(@NonNull
                                                                                              T treeNode,
                                                                                              K id)
        Find the occurrence of IBaseTreeNode object from the given key object that serves as the search target
        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
        id - the id for the search process
        Returns:
        the first occurrence of IBaseTreeNode object that have the same value as the given value
      • mergeTreeNodes

        public static <V,​K,​T extends IBaseTreeNode<V,​K,​T>> T mergeTreeNodes​(@NonNull
                                                                                                    T root,
                                                                                                    @NonNull
                                                                                                    @NonNull java.util.List<T> treeNodes)
        Merge the given tree nodes with the given root tree node
        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:
        root - the root tree node
        treeNodes - the tree nodes to merge with
        Returns:
        the root with the merged tree nodes
      • mergeTreeNodes

        public static <V,​K,​T extends IBaseTreeNode<V,​K,​T>> T mergeTreeNodes​(@NonNull
                                                                                                    T root,
                                                                                                    T... treeNodes)
        Merge the given tree nodes with the given root tree node
        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:
        root - the root tree node
        treeNodes - the tree nodes to merge with
        Returns:
        the root with the merged tree nodes