Uses of Interface
org.organicdesign.fp.function.Fn2
-
Packages that use Fn2 Package Description org.organicdesign.fp.collections Type-safe versions of immutable collections (mostly from Clojure), plus unmodifiable and immutable collection interfaces that fit these collections into the java.util interfaces.org.organicdesign.fp.function Exception-friendly functional interfaces named by the number of arguments: Fn0, Fn1, Fn2....org.organicdesign.fp.xform Immutable descriptions of data transformations (Transformable), and a highly efficient single-pass, short-circuiting implementation that carries out those transforms in a single pass (Xform). -
-
Uses of Fn2 in org.organicdesign.fp.collections
Methods in org.organicdesign.fp.collections with parameters of type Fn2 Modifier and Type Method Description default <B> BUnmodIterable. fold(B ident, @NotNull Fn2<? super B,? super T,B> reducer)Apply the function to each item, accumulating the result in u.default <G,B>
@NotNull Or<G,B>UnmodIterable. foldUntil(G accum, @Nullable Fn2<? super G,? super T,B> terminator, @NotNull Fn2<? super G,? super T,G> reducer)Normally you want to terminate by doing a take(), drop(), or takeWhile() before you get to the fold, but if you need to terminate based on the complete result so far, you can provide your own termination condition to this version of fold().static <T> voidUnmodList. permutations(@NotNull List<T> items, @NotNull Fn2<? super T,? super T,?> f)Apply the given function against all unique pairings of items in the list. -
Uses of Fn2 in org.organicdesign.fp.function
Classes in org.organicdesign.fp.function that implement Fn2 Modifier and Type Class Description static classFn2.SingletonsMethods in org.organicdesign.fp.function that return Fn2 Modifier and Type Method Description static <A1,B1>
@NotNull Fn2<A1,? super B1,A1>Fn2. first()Returns a static function that always returns the first argument it is given.static <A,B,Z>
@NotNull Fn2<A,B,Z>Fn2. memoize(@NotNull Fn2<A,B,Z> f)Use only on pure functions with no side effects.static <A1,B1>
@NotNull Fn2<A1,? super B1,B1>Fn2. second()Returns a static function that always returns the second argument it is given.Methods in org.organicdesign.fp.function with parameters of type Fn2 Modifier and Type Method Description static <A,B,Z>
@NotNull Fn2<A,B,Z>Fn2. memoize(@NotNull Fn2<A,B,Z> f)Use only on pure functions with no side effects. -
Uses of Fn2 in org.organicdesign.fp.xform
Methods in org.organicdesign.fp.xform with parameters of type Fn2 Modifier and Type Method Description <U> UTransformable. fold(U accum, @NotNull Fn2<? super U,? super T,U> reducer)Apply the function to each item, accumulating the result in u.<B> BXform. fold(B ident, @NotNull Fn2<? super B,? super A,B> reducer)Provides a way to collect the results of the transformation.<G,B>
@NotNull Or<G,B>Transformable. foldUntil(G accum, @Nullable Fn2<? super G,? super T,B> terminator, @NotNull Fn2<? super G,? super T,G> reducer)Normally you want to terminate by doing a take(), drop(), or takeWhile() before you get to the fold, but if you need to terminate based on the complete result so far, you can provide your own termination condition to this version of fold().<G,B>
@NotNull Or<G,B>Xform. foldUntil(G accum, @Nullable Fn2<? super G,? super A,B> terminator, @NotNull Fn2<? super G,? super A,G> reducer)This implementation should be correct, but could be slow in the case where previous operations are slow and the terminateWhen operation is fast and terminates early.
-