Class FingerTree<T,S>
java.lang.Object
org.reactfx.util.FingerTree<T,S>
- Direct Known Subclasses:
FingerTree.NonEmptyFingerTree
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionasList()Returns a list view of this tree.abstract Either<FingerTree<T, S>, FingerTree.NonEmptyFingerTree<T, S>> static <T,S> FingerTree <T, S> empty(ToSemigroup<? super T, S> statisticsProvider) abstract <R> Rfold(R acc, BiFunction<? super R, ? super T, ? extends R> reduction) <R> RfoldBetween(R acc, BiFunction<? super R, ? super T, ? extends R> reduction, int startLeaf, int endLeaf) <R> RfoldBetween(R acc, BiFunction<? super R, ? super T, ? extends R> reduction, ToIntFunction<? super S> metric, int startPosition, int endPosition, TetraFunction<? super R, ? super T, Integer, Integer, ? extends R> rangeReduction) get(ToIntFunction<? super S> metric, int index) <E> Eget(ToIntFunction<? super S> metric, int index, BiFunction<? super T, Integer, ? extends E> leafAccessor) abstract intgetDepth()getLeaf(int index) abstract intgetSummary(S whenEmpty) getSummaryBetween(int startLeaf, int endLeaf) getSummaryBetween(ToIntFunction<? super S> metric, int startPosition, int endPosition, TriFunction<? super T, Integer, Integer, ? extends S> subSummary) FingerTree<T, S> insertLeaf(int position, T data) final booleanisEmpty()abstract FingerTree<T, S> join(FingerTree<T, S> rightTree) locateProgressively(ToIntFunction<? super S> metric, int position) locateRegressively(ToIntFunction<? super S> metric, int position) static <T> FingerTree<T, Void> static <T,S> FingerTree <T, S> mkTree(List<? extends T> items, ToSemigroup<? super T, S> summaryProvider) FingerTree<T, S> removeLeafs(int fromLeaf, int toLeaf) Tuple2<FingerTree<T, S>, FingerTree<T, S>> split(int beforeLeaf) updateLeaf(int index, T data)
-
Method Details
-
empty
-
mkTree
-
mkTree
public static <T,S> FingerTree<T,S> mkTree(List<? extends T> items, ToSemigroup<? super T, S> summaryProvider) -
getDepth
public abstract int getDepth() -
getLeafCount
public abstract int getLeafCount() -
getSummaryOpt
-
caseEmpty
-
isEmpty
public final boolean isEmpty() -
getSummary
-
getLeaf
-
get
-
get
public <E> E get(ToIntFunction<? super S> metric, int index, BiFunction<? super T, Integer, ? extends E> leafAccessor) -
updateLeaf
-
locate
-
locateProgressively
-
locateRegressively
-
fold
-
foldBetween
public <R> R foldBetween(R acc, BiFunction<? super R, ? super T, ? extends R> reduction, int startLeaf, int endLeaf) -
foldBetween
public <R> R foldBetween(R acc, BiFunction<? super R, ? super T, ? extends R> reduction, ToIntFunction<? super S> metric, int startPosition, int endPosition, TetraFunction<? super R, ? super T, Integer, Integer, ? extends R> rangeReduction) -
getSummaryBetween
-
getSummaryBetween
public Optional<S> getSummaryBetween(ToIntFunction<? super S> metric, int startPosition, int endPosition, TriFunction<? super T, Integer, Integer, ? extends S> subSummary) -
split
-
removeLeafs
-
insertLeaf
-
join
-
append
-
prepend
-
asList
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. callingsubListon the result of previoussubList, up to n times: O(n).
-