Package org.reactfx.util
Class FingerTree.Empty<T,S>
- java.lang.Object
-
- org.reactfx.util.FingerTree<T,S>
-
- org.reactfx.util.FingerTree.Empty<T,S>
-
- Enclosing class:
- FingerTree<T,S>
private static final class FingerTree.Empty<T,S> extends FingerTree<T,S>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.reactfx.util.FingerTree
FingerTree.NonEmptyFingerTree<T,S>
-
-
Field Summary
-
Fields inherited from class org.reactfx.util.FingerTree
semigroup
-
-
Constructor Summary
Constructors Constructor Description Empty(ToSemigroup<? super T,S> semigroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<T>
asList()
Returns a list view of this tree.Either<FingerTree<T,S>,FingerTree.NonEmptyFingerTree<T,S>>
caseEmpty()
<R> R
fold(R acc, java.util.function.BiFunction<? super R,? super T,? extends R> reduction)
(package private) <R> R
foldBetween0(R acc, java.util.function.BiFunction<? super R,? super T,? extends R> reduction, int startLeaf, int endLeaf)
(package private) <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)
(package private) T
getData()
int
getDepth()
(package private) T
getLeaf0(int index)
int
getLeafCount()
(package private) S
getSummaryBetween0(int startLeaf, int endLeaf)
(package private) 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)
java.util.Optional<S>
getSummaryOpt()
FingerTree<T,S>
join(FingerTree<T,S> rightTree)
(package private) Tuple2<FingerTree<T,S>,FingerTree<T,S>>
split0(int beforeLeaf)
java.lang.String
toString()
(package private) FingerTree.NonEmptyFingerTree<T,S>
updateLeaf0(int index, T data)
-
Methods inherited from class org.reactfx.util.FingerTree
append, empty, empty, foldBetween, foldBetween, get, get, getLeaf, getSummary, getSummaryBetween, getSummaryBetween, insertLeaf, isEmpty, leaf, locate, locateProgressively, locateRegressively, measure, mkTree, mkTree, prepend, removeLeafs, split, updateLeaf
-
-
-
-
Constructor Detail
-
Empty
Empty(ToSemigroup<? super T,S> semigroup)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
caseEmpty
public Either<FingerTree<T,S>,FingerTree.NonEmptyFingerTree<T,S>> caseEmpty()
- Specified by:
caseEmpty
in classFingerTree<T,S>
-
getDepth
public int getDepth()
- Specified by:
getDepth
in classFingerTree<T,S>
-
getLeafCount
public int getLeafCount()
- Specified by:
getLeafCount
in classFingerTree<T,S>
-
join
public FingerTree<T,S> join(FingerTree<T,S> rightTree)
- Specified by:
join
in classFingerTree<T,S>
-
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. callingsubList
on the result of previoussubList
, up to n times: O(n).
- Specified by:
asList
in classFingerTree<T,S>
-
getLeaf0
T getLeaf0(int index)
- Specified by:
getLeaf0
in classFingerTree<T,S>
-
updateLeaf0
FingerTree.NonEmptyFingerTree<T,S> updateLeaf0(int index, T data)
- Specified by:
updateLeaf0
in classFingerTree<T,S>
-
getData
T getData()
- Specified by:
getData
in classFingerTree<T,S>
-
getSummaryOpt
public java.util.Optional<S> getSummaryOpt()
- Specified by:
getSummaryOpt
in classFingerTree<T,S>
-
fold
public <R> R fold(R acc, java.util.function.BiFunction<? super R,? super T,? extends R> reduction)
- Specified by:
fold
in classFingerTree<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 classFingerTree<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 classFingerTree<T,S>
-
getSummaryBetween0
S getSummaryBetween0(int startLeaf, int endLeaf)
- Specified by:
getSummaryBetween0
in classFingerTree<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 classFingerTree<T,S>
-
split0
Tuple2<FingerTree<T,S>,FingerTree<T,S>> split0(int beforeLeaf)
- Specified by:
split0
in classFingerTree<T,S>
-
-