|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A - function first argument typeB - function second argument typeC - function return type@Applicative public interface Function2<A,B,C>
Function2s are rich interfaced Applicable2s - two arguments
Delayable2 and NullSafeAware transformations.
Function2 can also be partially
applied, which means, applying it with less arguments than required,
returning, instead of the result of the transformation, a new function that
expects the rest of the arguments. Thus, Function2 do also implement
Applicable
| Method Summary | ||
|---|---|---|
Function<B,C> |
apply(A arg0)
Partially applies the function passing just its first parameter |
|
C |
apply(A arg0,
B arg1)
Applies the function |
|
Function2<B,A,C> |
flip()
Inverts function parameters order |
|
Function2<A,B,C> |
nullSafe()
Answers a new function that returns null if any of its arguments is null, or the result of applying this function, otherwise. |
|
|
of(Applicable<? super D,? extends A> function)
|
|
|
then(Function<? super C,? extends D> other)
Function composition, like Function.of(Applicable2), but with
receptor and argument interchanged. |
|
|
then(Function2<C,B2,D> binaryFunction,
Function<? super A2,? extends B2> other)
Answers a three arg function that combines this function with
other function, using a binaryFunction to merge
the results. |
|
Function<Tuple2<A,B>,C> |
uncurry()
Uncurries this function, by returning a Function that takes a
single pair, being its components each of the original function parameters |
|
| Methods inherited from interface net.sf.staccatocommons.defs.Delayable2 |
|---|
delayed, delayedValue |
| Method Detail |
|---|
Function<B,C> apply(A arg0)
apply in interface Applicable<A,Function<B,C>>arg0 - the transformation
C apply(A arg0,
B arg1)
apply in interface Applicable2<A,B,C>arg0 - the first transformation argumentarg1 - the second transformation argument
Function2<B,A,C> flip()
Function2 that produces the same result of this one
when applied, but with arguments flipped@NullSafe Function2<A,B,C> nullSafe()
nullSafe in interface NullSafeAware<Function2<A,B,C>>Function2<D> Function2<D,B,C> of(Applicable<? super D,? extends A> function)
D - function -
<D> Function2<A,B,D> then(@NonNull
Function<? super C,? extends D> other)
Function.of(Applicable2), but with
receptor and argument interchanged. Equivalent to other.of(this)
Functions get combined in the following figure:
>----+
+--this---+---other---->
>----+
C - other -
Function2
<A2,B2,D> Function3<A,B,A2,D> then(Function2<C,B2,D> binaryFunction,
@NonNull
Function<? super A2,? extends B2> other)
this function with
other function, using a binaryFunction to merge
the results.
The answered Function2 will apply this function to its first and
second argument argument, other function to the third
argument, and return the application of binaryFunction to both
resulting values.
Functions get combined in the following figure:
>----+
+--this-+
>----+ +---binaryFunction---->
|
>--other-----+
A2 - B2 - C - binayFunction - other -
Function3 the merges this and other
using the binaryFuncitonFunction<Tuple2<A,B>,C> uncurry()
Function that takes a
single pair, being its components each of the original function parameters
Function
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||