Class FingerTree.Empty<T,​S>

  • Enclosing class:
    FingerTree<T,​S>

    private static final class FingerTree.Empty<T,​S>
    extends FingerTree<T,​S>
    • Constructor Detail

    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • asList

        public java.util.List<T> asList()
        Description copied from class: FingerTree
        Returns a list view of this tree. Complexity of operations on the returned list:
        • size(): O(1);
        • get: O(log(n));
        • iteration: O(n) in either direction, with O(log(n)) total allocations;
        • subList: O(log(n));
        • iterative subList, i.e. calling subList on the result of previous subList, up to n times: O(n).
        Specified by:
        asList in class FingerTree<T,​S>
      • fold

        public <R> R fold​(R acc,
                          java.util.function.BiFunction<? super R,​? super T,​? extends R> reduction)
        Specified by:
        fold in class FingerTree<T,​S>
      • foldBetween0

        <R> R foldBetween0​(R acc,
                           java.util.function.BiFunction<? super R,​? super T,​? extends R> reduction,
                           int startLeaf,
                           int endLeaf)
        Specified by:
        foldBetween0 in class FingerTree<T,​S>
      • foldBetween0

        <R> R foldBetween0​(R acc,
                           java.util.function.BiFunction<? super R,​? super T,​? extends R> reduction,
                           java.util.function.ToIntFunction<? super S> metric,
                           int startPosition,
                           int endPosition,
                           TetraFunction<? super R,​? super T,​java.lang.Integer,​java.lang.Integer,​? extends R> rangeReduction)
        Specified by:
        foldBetween0 in class FingerTree<T,​S>
      • getSummaryBetween0

        S getSummaryBetween0​(java.util.function.ToIntFunction<? super S> metric,
                             int startPosition,
                             int endPosition,
                             TriFunction<? super T,​java.lang.Integer,​java.lang.Integer,​? extends S> subSummary)
        Specified by:
        getSummaryBetween0 in class FingerTree<T,​S>