Interface TreeModule


  • interface TreeModule
    Because the empty tree Empty cannot be a child of an existing tree, method implementations distinguish between the empty and non-empty case. Because the structure of trees is recursive, often we have commands in the form of module classes with one static method.
    • Method Detail

      • flatMap

        static <T,​U> Tree<U> flatMap​(Tree.Node<T> node,
                                           java.util.function.Function<? super T,​? extends java.lang.Iterable<? extends U>> mapper)
      • map

        static <T,​U> Tree.Node<U> map​(Tree.Node<T> node,
                                            java.util.function.Function<? super T,​? extends U> mapper)
      • replace

        static <T> Tree.Node<T> replace​(Tree.Node<T> node,
                                        T currentElement,
                                        T newElement)
      • zip

        static <T,​U,​R> Tree<R> zip​(Tree.Node<T> node,
                                               java.util.Iterator<? extends U> that,
                                               java.util.function.BiFunction<? super T,​? super U,​? extends R> mapper)
      • zipAll

        static <T,​U> Tree<Tuple2<T,​U>> zipAll​(Tree.Node<T> node,
                                                          java.util.Iterator<? extends U> that,
                                                          U thatElem)