|
com.im.commons 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.im.commons.Functional
public final class Functional
| Method Summary | ||
|---|---|---|
static
|
constant(T value)
Creates a constant function that returns value for any input. |
|
static
|
foldlNull(Function<Pair<A,B>,A> f,
A z,
Iterable<B> xs)
Version of foldl as it is known in functional programming word handling the null values. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <A,B> A foldlNull(Function<Pair<A,B>,A> f,
A z,
Iterable<B> xs)
foldl as it is known in functional programming word handling the null values.
Applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
f - reducing operatorz - starting valuexs - the list to be reduced
public static <F,T> Function<F,T> constant(T value)
value for any input. I.e. it ignore its input parameter.
This function is similar to the Functions.constant(E) from Guava library but is generic in its input
parameter which fits better in some scenarios.
value - the constant value for the function to return
value
|
com.im.commons 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||