Package fj.data.fingertrees
Class One<V,A>
- java.lang.Object
-
- fj.data.fingertrees.Digit<V,A>
-
- fj.data.fingertrees.One<V,A>
-
public final class One<V,A> extends Digit<V,A>
A single-element prefix or suffix of a finger tree.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <B> BfoldLeft(F<B,F<A,B>> bff, B z)Folds this digit to the left using the given function and the given initial value.<B> BfoldRight(F<A,F<B,B>> aff, B z)Folds this digit to the right using the given function and the given initial value.intlength()P2<java.lang.Integer,A>lookup(F<V,java.lang.Integer> o, int i)<B> Bmatch(F<One<V,A>,B> one, F<Two<V,A>,B> two, F<Three<V,A>,B> three, F<Four<V,A>,B> four)Structural pattern matching on digits.(package private) P3<Option<Digit<V,A>>,A,Option<Digit<V,A>>>split1(F<V,java.lang.Boolean> predicate, V acc)Stream<A>toStream()java.lang.StringtoString()Avalue()Returns the single element in this digit.-
Methods inherited from class fj.data.fingertrees.Digit
init, map, measure, measured, reduceLeft, reduceRight, tail, toTree
-
-
-
-
Field Detail
-
a
private final A a
-
-
Method Detail
-
foldRight
public <B> B foldRight(F<A,F<B,B>> aff, B z)
Description copied from class:DigitFolds this digit to the right using the given function and the given initial value.
-
foldLeft
public <B> B foldLeft(F<B,F<A,B>> bff, B z)
Description copied from class:DigitFolds this digit to the left using the given function and the given initial value.
-
match
public <B> B match(F<One<V,A>,B> one, F<Two<V,A>,B> two, F<Three<V,A>,B> three, F<Four<V,A>,B> four)
Description copied from class:DigitStructural pattern matching on digits. Applies the function that matches the structure of this digit.- Specified by:
matchin classDigit<V,A>- Parameters:
one- A function to apply to this digit if it's One.two- A function to apply to this digit if it's Two.three- A function to apply to this digit if it's Three.four- A function to apply to this digit if it's Four.- Returns:
- The result of applying the function matching this Digit.
-
value
public A value()
Returns the single element in this digit.- Returns:
- the single element in this digit.
-
split1
P3<Option<Digit<V,A>>,A,Option<Digit<V,A>>> split1(F<V,java.lang.Boolean> predicate, V acc)
-
-