Class TreeImpl

java.lang.Object
xyz.cofe.collection.TreeImpl

public class TreeImpl
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.util.WeakHashMap<Tree<?>,​java.util.List<Tree<?>>> nodes  
  • Constructor Summary

    Constructors 
    Constructor Description
    TreeImpl()  
  • Method Summary

    Modifier and Type Method Description
    static <A extends Tree<A>>
    java.util.List<Triple<java.lang.Integer,​A,​A>>
    append​(A tree, A... nodes)  
    static <A extends Tree<A>>
    void
    append​(A tree, A[] nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)  
    static <A extends Tree<A>>
    void
    append​(A tree, java.lang.Iterable<A> nodes)  
    static <A extends Tree<A>>
    void
    append​(A tree, java.lang.Iterable<A> nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)  
    static <A extends Tree<A>>
    void
    clear​(Tree<A> tree)  
    static <A extends Tree<A>>
    void
    clear​(Tree<A> tree, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)  
    static <A extends Tree<A>>
    void
    deleteByIndex​(Tree<A> tree, int... index)  
    static <A extends Tree<A>>
    void
    deleteByIndex​(Tree<A> tree, int[] index, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)  
    static <A extends Tree<A>>
    void
    deleteByIndex​(Tree<A> tree, java.lang.Iterable<java.lang.Integer> index)  
    static <A extends Tree<A>>
    void
    deleteByIndex​(Tree<A> tree, java.lang.Iterable<java.lang.Integer> index, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)  
    static <A extends Tree<A>>
    void
    deleteByValue​(Tree<A> tree, A... value)  
    static <A extends Tree<A>>
    void
    deleteByValue​(Tree<A> tree, A[] value, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)  
    static <A extends Tree<A>>
    void
    deleteByValue​(Tree<A> tree, java.lang.Iterable<A> value)  
    static <A extends Tree<A>>
    void
    deleteByValue​(Tree<A> tree, java.lang.Iterable<A> value, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)  
    static <A extends Tree<A>>
    java.util.List<Triple<java.lang.Integer,​A,​A>>
    insert​(Tree<A> tree, int index, A... nodes)  
    static <A extends Tree<A>>
    void
    insert​(Tree<A> tree, int index, A[] nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)  
    static <A extends Tree<A>>
    java.util.List<Triple<java.lang.Integer,​A,​A>>
    insert​(Tree<A> tree, int index, java.lang.Iterable<A> nodes)  
    static <A extends Tree<A>>
    void
    insert​(Tree<A> tree, int index, java.lang.Iterable<A> nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)  
    static <A extends Tree<A>>
    A
    node​(Tree<A> tree, int index)  
    static int nodesCount​(Tree tree)  
    static <A extends Tree<A>>
    java.util.List<A>
    nodesOf​(Tree<A> tree)  
    static <A extends Tree<A>>
    java.util.List<Triple<java.lang.Integer,​A,​A>>
    set​(Tree<A> tree, int index, A... values)  
    static <A extends Tree<A>>
    void
    set​(Tree<A> tree, int index, A[] values, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)  
    static <A extends Tree<A>>
    java.util.List<Triple<java.lang.Integer,​A,​A>>
    set​(Tree<A> tree, int index, java.lang.Iterable<A> values)  
    static <A extends Tree<A>>
    void
    set​(Tree<A> tree, int index, java.lang.Iterable<A> values, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nodes

      public static final java.util.WeakHashMap<Tree<?>,​java.util.List<Tree<?>>> nodes
  • Constructor Details

  • Method Details

    • nodesOf

      public static <A extends Tree<A>> java.util.List<A> nodesOf​(Tree<A> tree)
    • nodesCount

      public static int nodesCount​(Tree tree)
    • node

      public static <A extends Tree<A>> A node​(Tree<A> tree, int index)
    • set

      public static <A extends Tree<A>> java.util.List<Triple<java.lang.Integer,​A,​A>> set​(Tree<A> tree, int index, A... values)
    • set

      public static <A extends Tree<A>> void set​(Tree<A> tree, int index, A[] values, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)
    • set

      public static <A extends Tree<A>> java.util.List<Triple<java.lang.Integer,​A,​A>> set​(Tree<A> tree, int index, java.lang.Iterable<A> values)
    • set

      public static <A extends Tree<A>> void set​(Tree<A> tree, int index, java.lang.Iterable<A> values, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)
    • insert

      public static <A extends Tree<A>> java.util.List<Triple<java.lang.Integer,​A,​A>> insert​(Tree<A> tree, int index, A... nodes)
    • insert

      public static <A extends Tree<A>> void insert​(Tree<A> tree, int index, A[] nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)
    • insert

      public static <A extends Tree<A>> java.util.List<Triple<java.lang.Integer,​A,​A>> insert​(Tree<A> tree, int index, java.lang.Iterable<A> nodes)
    • insert

      public static <A extends Tree<A>> void insert​(Tree<A> tree, int index, java.lang.Iterable<A> nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)
    • append

      public static <A extends Tree<A>> java.util.List<Triple<java.lang.Integer,​A,​A>> append​(A tree, A... nodes)
    • append

      public static <A extends Tree<A>> void append​(A tree, A[] nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)
    • append

      public static <A extends Tree<A>> void append​(A tree, java.lang.Iterable<A> nodes)
    • append

      public static <A extends Tree<A>> void append​(A tree, java.lang.Iterable<A> nodes, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> added)
    • deleteByIndex

      public static <A extends Tree<A>> void deleteByIndex​(Tree<A> tree, int... index)
    • deleteByIndex

      public static <A extends Tree<A>> void deleteByIndex​(Tree<A> tree, int[] index, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)
    • deleteByIndex

      public static <A extends Tree<A>> void deleteByIndex​(Tree<A> tree, java.lang.Iterable<java.lang.Integer> index)
    • deleteByIndex

      public static <A extends Tree<A>> void deleteByIndex​(Tree<A> tree, java.lang.Iterable<java.lang.Integer> index, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)
    • deleteByValue

      public static <A extends Tree<A>> void deleteByValue​(Tree<A> tree, A... value)
    • deleteByValue

      public static <A extends Tree<A>> void deleteByValue​(Tree<A> tree, java.lang.Iterable<A> value)
    • deleteByValue

      public static <A extends Tree<A>> void deleteByValue​(Tree<A> tree, A[] value, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)
    • deleteByValue

      public static <A extends Tree<A>> void deleteByValue​(Tree<A> tree, java.lang.Iterable<A> value, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)
    • clear

      public static <A extends Tree<A>> void clear​(Tree<A> tree)
    • clear

      public static <A extends Tree<A>> void clear​(Tree<A> tree, java.util.function.Consumer<Triple<java.lang.Integer,​A,​A>> deleted)