|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.plt.lambda.LambdaUtil
public final class LambdaUtil
A collection of constants and static methods that define or operate on lambdas, runnables, and predicates. Since most of these operations apply to lambdas of arbitrary arity, they are defined here in groups with similar or identical names, but slightly different types. These groups include:
promote: add an additional, ignored argument to a runnable, lambda, or predicatecompose: define the lambda that takes the result of one lambda and applies it
to another, or a runnable that executes a sequence of runnablesbindFirst, bindSecond, etc.: set one of the arguments to a lambdacurry: convert an n-ary lambda to a unary lambda whose result is another lambdatranspose: swap the order of a binary lambda's argumentsflatten, unary: convert between lambdas, etc., that take multiple arguments
and equivalent lambdas that take exactly one tuple argument.wrapPartial: use "none" option values to represent exception and null resultslift: extend a lambda to handle option values (see Option)negate: define a predicate whose result is the opposite of the given predicateand: define a conjunction of predicatesor: define a disjunction of predicatesasRunnable: define a runnable equivalent to the given lambda, ignoring the resultasLambda: define a lambda equivalent to the given runnable, returning the given
result after executionasPredicate: treat a lambda with a Boolean return type as a predicateLambdaUtil.GeneralRunnable, LambdaUtil.GeneralLambda, and LambdaUtil.GeneralPredicate are defined
to facilitate such definitions.
Most classes instantiated by these methods are serializable. However, since the classes generally wrap other objects, those objects must be serializable in order for serialization to succeed.
| Nested Class Summary | |
|---|---|
static interface |
LambdaUtil.GeneralLambda<R>
An object that functions as a lambda for all arities. |
static interface |
LambdaUtil.GeneralPredicate
An object that functions as a predicate for all arities. |
static interface |
LambdaUtil.GeneralRunnable
An object that functions as a runnable for all arities. |
static interface |
LambdaUtil.LiftedLambda<T,R>
A Lambda that accepts and produces Option values. |
static interface |
LambdaUtil.LiftedLambda2<T1,T2,R>
A Lambda2 that accepts and produces Option values. |
static interface |
LambdaUtil.LiftedLambda3<T1,T2,T3,R>
A Lambda3 that accepts and produces Option values. |
static interface |
LambdaUtil.LiftedLambda4<T1,T2,T3,T4,R>
A Lambda4 that accepts and produces Option values. |
| Field Summary | |
|---|---|
static Lambda2<Integer,Integer,Integer> |
ADD_INT
Add two integers. |
static Lambda<Integer,Integer> |
DECREMENT_INT
Decrements an integer. |
static Lambda2<Integer,Integer,Integer> |
DIVIDE_INT
Divide two integers. |
static Predicate2<Object,Object> |
EQUAL
A predicate that evaluates to RecurUtil.safeEquals(Object, Object) applied to the arguments. |
static LambdaUtil.GeneralPredicate |
FALSE
A predicate whose result is always false. |
static Lambda<Object,Integer> |
HASH_CODE
Calls RecurUtil.safeHashCode(Object) on the input. |
static Predicate2<Object,Object> |
IDENTICAL
A predicate that returns true iff arg1 == arg2. |
static Lambda<Integer,Integer> |
INCREMENT_INT
Increments an integer. |
static Predicate2<Object,Class<?>> |
INSTANCE_OF
A predicate that returns true iff the first argument is an instance of the second argument. |
static Predicate<Object> |
IS_NULL
A predicate that returns true iff the argument is null. |
static Lambda2<Integer,Integer,Integer> |
MULTIPLY_INT
Multiply two integers. |
static LambdaUtil.GeneralRunnable |
NO_OP
A runnable that does nothing. |
static Predicate2<Object,Object> |
NOT_EQUAL
A predicate that evaluates to the opposite of RecurUtil.safeEquals(Object, Object) applied to
the arguments. |
static Predicate2<Object,Object> |
NOT_IDENTICAL
A predicate that returns true iff arg1 != arg2. |
static Predicate<Object> |
NOT_NULL
A predicate that returns true iff the argument is not null. |
static Lambda2<Object,Object,String> |
STRING_CONCAT
Concatenate the result of RecurUtil.safeToString(Object) from both inputs. |
static Lambda2<Integer,Integer,Integer> |
SUBTRACT_INT
Subtract two integers. |
static Lambda<Object,String> |
TO_STRING
Calls RecurUtil.safeToString(Object) on the input. |
static LambdaUtil.GeneralPredicate |
TRUE
A predicate whose result is always true. |
| Method Summary | ||
|---|---|---|
static Condition |
and(Condition c1,
Condition c2)
Produce the conjunction ( &&) of c1 and c2. |
|
static Condition |
and(Condition c1,
Condition c2,
Condition c3)
Produce the conjunction ( &&) of c1, c2, and c3. |
|
static
|
and(Iterable<? extends Predicate<? super T>> preds)
Produce the conjunction ( &&) of the given predicates. |
|
static
|
and(Predicate<? super T> p1,
Predicate<? super T> p2)
Produce the conjunction ( &&) of p1 and p2. |
|
static
|
and(Predicate<? super T> p1,
Predicate<? super T> p2,
Predicate<? super T> p3)
Produce the conjunction ( &&) of p1, p2, and p3. |
|
static
|
and(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2)
Produce the conjunction ( &&) of p1 and p2. |
|
static
|
and(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2,
Predicate2<? super T1,? super T2> p3)
Produce the conjunction ( &&) of p1, p2, and p3. |
|
static
|
and(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2)
Produce the conjunction ( &&) of p1 and p2. |
|
static
|
and(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2,
Predicate3<? super T1,? super T2,? super T3> p3)
Produce the conjunction ( &&) of p1, p2, and p3. |
|
static
|
and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
Produce the conjunction ( &&) of p1 and p2. |
|
static
|
and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2,
Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
Produce the conjunction ( &&) of p1, p2, and p3. |
|
static Condition |
and0(Iterable<? extends Condition> conds)
Produce the conjunction ( &&) of the given conditions. |
|
static
|
and2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
Produce the conjunction ( &&) of the given predicates. |
|
static
|
and3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
Produce the conjunction ( &&) of the given predicates. |
|
static
|
and4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
Produce the conjunction ( &&) of the given predicates. |
|
static
|
applicationLambda()
Create a lambda that applies its first argument to its second argument. |
|
static Condition |
asCondition(Thunk<? extends Boolean> thunk)
Create a condition based on an input that acts as a condition but is not typed as one. |
|
static
|
asLambda(Predicate<? super T> predicate)
Create a Boolean lambda based on a predicate. |
|
static
|
asLambda(Predicate2<? super T1,? super T2> predicate)
Create a Boolean lambda based on a predicate. |
|
static
|
asLambda(Predicate3<? super T1,? super T2,? super T3> predicate)
Create a Boolean lambda based on a predicate. |
|
static
|
asLambda(Predicate4<? super T1,? super T2,? super T3,? super T4> predicate)
Create a Boolean lambda based on a predicate. |
|
static
|
asLambda(Runnable1<? super T> r)
Create a lambda that executes the given runnable, then returns null. |
|
static
|
asLambda(Runnable1<? super T> r,
R result)
Create a lambda that executes the given runnable, then returns result. |
|
static
|
asLambda(Runnable2<? super T1,? super T2> r)
Create a lambda that executes the given runnable, then returns null. |
|
static
|
asLambda(Runnable2<? super T1,? super T2> r,
R result)
Create a lambda that executes the given runnable, then returns result. |
|
static
|
asLambda(Runnable3<? super T1,? super T2,? super T3> r)
Create a lambda that executes the given runnable, then returns null. |
|
static
|
asLambda(Runnable3<? super T1,? super T2,? super T3> r,
R result)
Create a lambda that executes the given runnable, then returns result. |
|
static
|
asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r)
Create a lambda that executes the given runnable, then returns null. |
|
static
|
asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r,
R result)
Create a lambda that executes the given runnable, then returns result. |
|
static
|
asPredicate(Lambda<? super T,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one. |
|
static
|
asPredicate(Lambda2<? super T1,? super T2,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one. |
|
static
|
asPredicate(Lambda3<? super T1,? super T2,? super T3,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one. |
|
static
|
asPredicate(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one. |
|
static
|
asRunnable(Lambda<? super T,?> lambda)
Create a runnable that executes the given lambda (ignoring the result). |
|
static
|
asRunnable(Lambda2<? super T1,? super T2,?> lambda)
Create a runnable that executes the given lambda (ignoring the result). |
|
static
|
asRunnable(Lambda3<? super T1,? super T2,? super T3,?> lambda)
Create a runnable that executes the given lambda (ignoring the result). |
|
static
|
asRunnable(Lambda4<? super T1,? super T2,? super T3,? super T4,?> lambda)
Create a runnable that executes the given lambda (ignoring the result). |
|
static Runnable |
asRunnable(Thunk<?> thunk)
Create a runnable that executes the given thunk (ignoring the result). |
|
static Thunk<Boolean> |
asThunk(Condition cond)
Create a Boolean thunk based on a condition. |
|
static Thunk<Void> |
asThunk(Runnable r)
Create a thunk that executes the given runnable, then returns null. |
|
static
|
asThunk(Runnable r,
R result)
Create a thunk that executes the given runnable, then returns result. |
|
static
|
binaryApplicationLambda()
Create a lambda that applies its first argument to its second argument. |
|
static
|
bindFirst(Lambda<? super T,? extends R> lambda,
T arg)
Bind a fixed argument to the given lambda, producing a thunk. |
|
static
|
bindFirst(Lambda2<? super T1,? super T2,? extends R> lambda,
T1 arg1)
Bind a fixed argument to the given binary lambda, producing a unary lambda. |
|
static
|
bindFirst(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
T1 arg1)
Bind a fixed argument to the given ternary lambda, producing a binary lambda. |
|
static
|
bindFirst(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T1 arg1)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda. |
|
static
|
bindFirst(Predicate<? super T> pred,
T arg)
Bind a fixed argument to the given predicate, producing a condition. |
|
static
|
bindFirst(Predicate2<? super T1,? super T2> pred,
T1 arg1)
Bind a fixed argument to the given binary predicate, producing a unary prediate. |
|
static
|
bindFirst(Predicate3<? super T1,? super T2,? super T3> pred,
T1 arg1)
Bind a fixed argument to the given ternary predicate, producing a binary predicate. |
|
static
|
bindFirst(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T1 arg1)
Bind a fixed argument to the given quaternary predicate, producing a ternary predicate. |
|
static
|
bindFirst(Runnable1<? super T> runnable,
T arg)
Bind a fixed argument to the given unary runnable, producing nullary runnable. |
|
static
|
bindFirst(Runnable2<? super T1,? super T2> runnable,
T1 arg1)
Bind a fixed argument to the given binary runnable, producing a unary runnable. |
|
static
|
bindFirst(Runnable3<? super T1,? super T2,? super T3> runnable,
T1 arg1)
Bind a fixed argument to the given ternary runnable, producing a binary runnable. |
|
static
|
bindFirst(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T1 arg1)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable. |
|
static
|
bindFourth(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T4 arg4)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda. |
|
static
|
bindFourth(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T4 arg4)
Bind a fixed argument to the given quaternary pred, producing a ternary pred. |
|
static
|
bindFourth(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T4 arg4)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable. |
|
static
|
bindSecond(Lambda2<? super T1,? super T2,? extends R> lambda,
T2 arg2)
Bind a fixed argument to the given binary lambda, producing a unary lambda. |
|
static
|
bindSecond(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
T2 arg2)
Bind a fixed argument to the given ternary lambda, producing a binary lambda. |
|
static
|
bindSecond(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T2 arg2)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda. |
|
static
|
bindSecond(Predicate2<? super T1,? super T2> pred,
T2 arg2)
Bind a fixed argument to the given binary predicate, producing a unary predicate. |
|
static
|
bindSecond(Predicate3<? super T1,? super T2,? super T3> pred,
T2 arg2)
Bind a fixed argument to the given ternary predicate, producing a binary predicate. |
|
static
|
bindSecond(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T2 arg2)
Bind a fixed argument to the given quaternary predicate, producing a ternary predicate. |
|
static
|
bindSecond(Runnable2<? super T1,? super T2> runnable,
T2 arg2)
Bind a fixed argument to the given binary runnable, producing a unary runnable. |
|
static
|
bindSecond(Runnable3<? super T1,? super T2,? super T3> runnable,
T2 arg2)
Bind a fixed argument to the given ternary runnable, producing a binary runnable. |
|
static
|
bindSecond(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T2 arg2)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable. |
|
static
|
bindThird(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
T3 arg3)
Bind a fixed argument to the given ternary lambda, producing a binary lambda. |
|
static
|
bindThird(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T3 arg3)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda. |
|
static
|
bindThird(Predicate3<? super T1,? super T2,? super T3> pred,
T3 arg3)
Bind a fixed argument to the given ternary predicate, producing a binary predicate. |
|
static
|
bindThird(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T3 arg3)
Bind a fixed argument to the given quaternary predicate, producing a ternary predicate. |
|
static
|
bindThird(Runnable3<? super T1,? super T2,? super T3> runnable,
T3 arg3)
Bind a fixed argument to the given ternary runnable, producing a binary runnable. |
|
static
|
bindThird(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T3 arg3)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable. |
|
static Runnable |
compose(Iterable<? extends Runnable> runnables)
Create a runnable that executes the given runnables in sequence. |
|
static
|
compose(Lambda<? super S,? extends T> l1,
Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1. |
|
static
|
compose(Lambda2<? super S1,? super S2,? extends T> l1,
Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1. |
|
static
|
compose(Lambda3<? super S1,? super S2,? super S3,? extends T> l1,
Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1. |
|
static
|
compose(Lambda4<? super S1,? super S2,? super S3,? super S4,? extends T> l1,
Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1. |
|
static Runnable |
compose(Runnable... runnables)
Create a runnable that executes the given runnables in sequence. |
|
static
|
compose(Runnable1<? super T> r1,
Runnable1<? super T> r2)
Create a runnable that executes r1 followed by r2 with the same input. |
|
static
|
compose(Runnable1<? super T> r1,
Runnable1<? super T> r2,
Runnable1<? super T> r3)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
compose(Runnable2<? super T1,? super T2> r1,
Runnable2<? super T1,? super T2> r2)
Create a runnable that executes r1 followed by r2 with the same input. |
|
static
|
compose(Runnable2<? super T1,? super T2> r1,
Runnable2<? super T1,? super T2> r2,
Runnable2<? super T1,? super T2> r3)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
compose(Runnable3<? super T1,? super T2,? super T3> r1,
Runnable3<? super T1,? super T2,? super T3> r2)
Create a runnable that executes r1 followed by r2 with the same input. |
|
static
|
compose(Runnable3<? super T1,? super T2,? super T3> r1,
Runnable3<? super T1,? super T2,? super T3> r2,
Runnable3<? super T1,? super T2,? super T3> r3)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1,
Runnable4<? super T1,? super T2,? super T3,? super T4> r2)
Create a runnable that executes r1 followed by r2 with the same input. |
|
static
|
compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1,
Runnable4<? super T1,? super T2,? super T3,? super T4> r2,
Runnable4<? super T1,? super T2,? super T3,? super T4> r3)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
compose(Thunk<? extends T> thunk,
Lambda<? super T,? extends U> lambda)
Create a thunk that executes lambda with the result of thunk. |
|
static
|
compose1(Iterable<? extends Runnable1<? super T>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
compose2(Iterable<? extends Runnable2<? super T1,? super T2>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
compose3(Iterable<? extends Runnable3<? super T1,? super T2,? super T3>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
compose4(Iterable<? extends Runnable4<? super T1,? super T2,? super T3,? super T4>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. |
|
static
|
curry(Lambda2<? super T1,? super T2,? extends R> lambda)
Create a curried version of the input, which accepts a single argument and returns a lambda on the second argument. |
|
static
|
curry(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Create a curried version of the input, which accepts a single argument and returns a curried lambda on the other arguments. |
|
static
|
curry(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
Create a curried version of the input, which accepts a single argument and returns a curried lambda on the other arguments. |
|
static
|
exceptionLambda(RuntimeException e)
Create a lambda that always throws the given exception. |
|
static
|
flatten0(Lambda<? super Null<T>,? extends R> lambda)
Treat a lambda accepting a 0-tuple argument as a Thunk. |
|
static
|
flatten0(Predicate<? super Null<T>> pred)
Treat a predicate accepting a 0-tuple argument as a Condition. |
|
static
|
flatten0(Runnable1<? super Null<T>> runnable)
Treat a runnable accepting a 0-tuple argument as a Runnable. |
|
static
|
flatten2(Lambda<? super Pair<T1,T2>,? extends R> lambda)
Treat a lambda accepting a Pair argument as a Lambda2. |
|
static
|
flatten2(Predicate<? super Pair<T1,T2>> pred)
Treat a predicate accepting a Pair argument as a Predicate2. |
|
static
|
flatten2(Runnable1<? super Pair<T1,T2>> runnable)
Treat a runnable accepting a Pair argument as a Runnable2. |
|
static
|
flatten3(Lambda<? super Triple<T1,T2,T3>,? extends R> lambda)
Treat a lambda accepting a Triple argument as a Lambda3. |
|
static
|
flatten3(Predicate<? super Triple<T1,T2,T3>> pred)
Treat a predicate accepting a Triple argument as a Predicate3. |
|
static
|
flatten3(Runnable1<? super Triple<T1,T2,T3>> runnable)
Treat a runnable accepting a Triple argument as a Runnable3. |
|
static
|
flatten4(Lambda<? super Quad<T1,T2,T3,T4>,? extends R> lambda)
Treat a lambda accepting a Quad argument as a Lambda4. |
|
static
|
flatten4(Predicate<? super Quad<T1,T2,T3,T4>> pred)
Treat a predicate accepting a Quad argument as a Predicate4. |
|
static
|
flatten4(Runnable1<? super Quad<T1,T2,T3,T4>> runnable)
Treat a runnable accepting a Quad argument as a Runnable4. |
|
static
|
identity()
Create the identity lambda for the type T. |
|
static
|
lift(Lambda<? super T,? extends R> lambda)
Lift a Lambda to accept an option value, returning Option.none() in the "none" case. |
|
static
|
lift(Lambda2<? super T1,? super T2,? extends R> lambda)
Lift a Lambda2 to accept option values, returning Option.none() if any argument is "none". |
|
static
|
lift(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Lift a Lambda3 to accept option values, returning Option.none() if any argument is "none". |
|
static
|
lift(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
Lift a Lambda4 to accept option values, returning Option.none() if any argument is "none". |
|
static Condition |
negate(Condition cond)
Produce the negation ( !) of cond. |
|
static
|
negate(Predicate<? super T> pred)
Produce the negation ( !) of pred. |
|
static
|
negate(Predicate2<? super T1,? super T2> pred)
Produce the negation ( !) of pred. |
|
static
|
negate(Predicate3<? super T1,? super T2,? super T3> pred)
Produce the negation ( !) of pred. |
|
static
|
negate(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
Produce the negation ( !) of pred. |
|
static
|
nullLambda()
Create a lambda whose result is always null. |
|
static Condition |
or(Condition c1,
Condition c2)
Produce the disjunction ( ||) of c1 and c2. |
|
static Condition |
or(Condition c1,
Condition c2,
Condition c3)
Produce the disjunction ( ||) of c1, c2, and c3. |
|
static
|
or(Iterable<? extends Predicate<? super T>> preds)
Produce the disjunction ( ||) of the given predicates. |
|
static
|
or(Predicate<? super T> p1,
Predicate<? super T> p2)
Produce the disjunction ( ||) of p1 and p2. |
|
static
|
or(Predicate<? super T> p1,
Predicate<? super T> p2,
Predicate<? super T> p3)
Produce the disjunction ( ||) of p1, p2, and p3. |
|
static
|
or(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2)
Produce the disjunction ( ||) of p1 and p2. |
|
static
|
or(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2,
Predicate2<? super T1,? super T2> p3)
Produce the disjunction ( ||) of p1, p2, and p3. |
|
static
|
or(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2)
Produce the disjunction ( ||) of p1 and p2. |
|
static
|
or(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2,
Predicate3<? super T1,? super T2,? super T3> p3)
Produce the disjunction ( ||) of p1, p2, and p3. |
|
static
|
or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
Produce the disjunction ( ||) of p1 and p2. |
|
static
|
or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2,
Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
Produce the disjunction ( ||) of p1, p2, and p3. |
|
static Condition |
or0(Iterable<? extends Condition> conds)
Produce the disjunction ( ||) of the given conditions. |
|
static
|
or2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
Produce the conjunction ( ||) of the given predicates. |
|
static
|
or3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
Produce the conjunction ( ||) of the given predicates. |
|
static
|
or4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
Produce the conjunction ( ||) of the given predicates. |
|
static LambdaUtil.GeneralPredicate |
promote(Condition cond)
Create a GeneralPredicate equivalent to cond that ignores any arguments. |
|
static
|
promote(Lambda<? super T,? extends R> lambda)
Create a Lambda2 equivalent to lambda with an additional, ignored argument. |
|
static
|
promote(Lambda2<? super T1,? super T2,? extends R> lambda)
Create a Lambda3 equivalent to lambda with an additional, ignored argument. |
|
static
|
promote(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Create a Lambda4 equivalent to lambda with an additional, ignored argument. |
|
static
|
promote(Predicate<? super T> pred)
Create a Predicate2 equivalent to pred with an additional, ignored argument. |
|
static
|
promote(Predicate2<? super T1,? super T2> pred)
Create a Predicate3 equivalent to pred with an additional, ignored argument. |
|
static
|
promote(Predicate3<? super T1,? super T2,? super T3> pred)
Create a Predicate4 equivalent to pred with an additional, ignored argument. |
|
static LambdaUtil.GeneralRunnable |
promote(Runnable r)
Create a GeneralRunnable equivalent to r that ignores any arguments. |
|
static
|
promote(Runnable1<? super T> r)
Create a Runnable2 equivalent to r with an additional, ignored argument. |
|
static
|
promote(Runnable2<? super T1,? super T2> r)
Create a Runnable3 equivalent to r with an additional, ignored argument. |
|
static
|
promote(Runnable3<? super T1,? super T2,? super T3> r)
Create a Runnable4 equivalent to r with an additional, ignored argument. |
|
static
|
promote(Thunk<? extends R> thunk)
Create a GeneralLambda equivalent to thunk that ignores any arguments. |
|
static
|
ternaryApplicationLambda()
Create a lambda that applies its first argument to its second argument. |
|
static
|
thunkValueLambda()
Create a lambda that applies its first argument to its second argument. |
|
static
|
transpose(Lambda2<? super T1,? super T2,? extends R> lambda)
Swap the order of a binary lambda's arguments. |
|
static
|
transpose(Predicate2<? super T1,? super T2> pred)
Swap the order of a binary predicate's arguments. |
|
static
|
transpose(Runnable2<? super T1,? super T2> r)
Swap the order of a binary runnable's arguments. |
|
static Predicate<Null<?>> |
unary(Condition cond)
Treat a Condition as a unary predicate accepting a 0-tuple argument. |
|
static
|
unary(Lambda2<? super T1,? super T2,? extends R> lambda)
Treat a Lambda2 as a unary lambda accepting a Pair argument. |
|
static
|
unary(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Treat a Lambda3 as a unary lambda accepting a Triple argument. |
|
static
|
unary(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
Treat a Lambda4 as a unary lambda accepting a Quad argument. |
|
static
|
unary(Predicate2<? super T1,? super T2> pred)
Treat a Predicate2 as a unary predicate accepting a Pair argument. |
|
static
|
unary(Predicate3<? super T1,? super T2,? super T3> pred)
Treat a Predicate3 as a unary predicate accepting a Triple argument. |
|
static
|
unary(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
Treat a Predicate4 as a unary predicate accepting a Quad argument. |
|
static Runnable1<Null<?>> |
unary(Runnable runnable)
Treat a Runnable as a Runnable1 accepting a 0-tuple argument. |
|
static
|
unary(Runnable2<? super T1,? super T2> runnable)
Treat a Runnable2 as a Runnable1 accepting a Pair argument. |
|
static
|
unary(Runnable3<? super T1,? super T2,? super T3> runnable)
Treat a Runnable3 as a Runnable1 accepting a Triple argument. |
|
static
|
unary(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable)
Treat a Runnable4 as a Runnable1 accepting a Quad argument. |
|
static
|
unary(Thunk<? extends R> thunk)
Treat a Thunk as a unary lambda accepting a 0-tuple argument. |
|
static
|
valueLambda(T val)
Create a lambda whose result is always val. |
|
static
|
wrapPartial(Lambda<? super T,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". |
|
static
|
wrapPartial(Lambda2<? super T1,? super T2,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". |
|
static
|
wrapPartial(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". |
|
static
|
wrapPartial(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". |
|
static
|
wrapPartial(Thunk<? extends R> thunk,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
Treat the given thunk as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final LambdaUtil.GeneralRunnable NO_OP
public static final LambdaUtil.GeneralPredicate TRUE
true.
public static final LambdaUtil.GeneralPredicate FALSE
false.
public static final Predicate<Object> IS_NULL
true iff the argument is null.
public static final Predicate<Object> NOT_NULL
true iff the argument is not null.
public static final Predicate2<Object,Object> EQUAL
RecurUtil.safeEquals(Object, Object) applied to the arguments.
public static final Predicate2<Object,Object> NOT_EQUAL
RecurUtil.safeEquals(Object, Object) applied to
the arguments.
public static final Predicate2<Object,Object> IDENTICAL
true iff arg1 == arg2.
public static final Predicate2<Object,Object> NOT_IDENTICAL
true iff arg1 != arg2.
public static final Predicate2<Object,Class<?>> INSTANCE_OF
true iff the first argument is an instance of the second argument.
public static final Lambda<Object,String> TO_STRING
RecurUtil.safeToString(Object) on the input.
public static final Lambda2<Object,Object,String> STRING_CONCAT
RecurUtil.safeToString(Object) from both inputs.
public static final Lambda<Object,Integer> HASH_CODE
RecurUtil.safeHashCode(Object) on the input.
public static final Lambda<Integer,Integer> INCREMENT_INT
public static final Lambda<Integer,Integer> DECREMENT_INT
public static final Lambda2<Integer,Integer,Integer> ADD_INT
public static final Lambda2<Integer,Integer,Integer> SUBTRACT_INT
public static final Lambda2<Integer,Integer,Integer> MULTIPLY_INT
public static final Lambda2<Integer,Integer,Integer> DIVIDE_INT
| Method Detail |
|---|
public static <T> Lambda<T,T> identity()
T.
public static <T> LambdaUtil.GeneralLambda<T> nullLambda()
null.
public static <T> LambdaUtil.GeneralLambda<T> exceptionLambda(RuntimeException e)
value() is invoked.
public static <T> LambdaUtil.GeneralLambda<T> valueLambda(T val)
val.
public static <R> Lambda<Thunk<? extends R>,R> thunkValueLambda()
public static <T,R> Lambda2<Lambda<? super T,? extends R>,T,R> applicationLambda()
public static <T1,T2,R> Lambda3<Lambda2<? super T1,? super T2,? extends R>,T1,T2,R> binaryApplicationLambda()
public static <T1,T2,T3,R> Lambda4<Lambda3<? super T1,? super T2,? super T3,? extends R>,T1,T2,T3,R> ternaryApplicationLambda()
public static LambdaUtil.GeneralRunnable promote(Runnable r)
GeneralRunnable equivalent to r that ignores any arguments.
public static <T> Runnable2<T,Object> promote(Runnable1<? super T> r)
Runnable2 equivalent to r with an additional, ignored argument.
public static <T1,T2> Runnable3<T1,T2,Object> promote(Runnable2<? super T1,? super T2> r)
Runnable3 equivalent to r with an additional, ignored argument.
public static <T1,T2,T3> Runnable4<T1,T2,T3,Object> promote(Runnable3<? super T1,? super T2,? super T3> r)
Runnable4 equivalent to r with an additional, ignored argument.
public static <R> LambdaUtil.GeneralLambda<R> promote(Thunk<? extends R> thunk)
GeneralLambda equivalent to thunk that ignores any arguments.
public static <T,R> Lambda2<T,Object,R> promote(Lambda<? super T,? extends R> lambda)
Lambda2 equivalent to lambda with an additional, ignored argument.
public static <T1,T2,R> Lambda3<T1,T2,Object,R> promote(Lambda2<? super T1,? super T2,? extends R> lambda)
Lambda3 equivalent to lambda with an additional, ignored argument.
public static <T1,T2,T3,R> Lambda4<T1,T2,T3,Object,R> promote(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Lambda4 equivalent to lambda with an additional, ignored argument.
public static LambdaUtil.GeneralPredicate promote(Condition cond)
GeneralPredicate equivalent to cond that ignores any arguments.
public static <T> Predicate2<T,Object> promote(Predicate<? super T> pred)
Predicate2 equivalent to pred with an additional, ignored argument.
public static <T1,T2> Predicate3<T1,T2,Object> promote(Predicate2<? super T1,? super T2> pred)
Predicate3 equivalent to pred with an additional, ignored argument.
public static <T1,T2,T3> Predicate4<T1,T2,T3,Object> promote(Predicate3<? super T1,? super T2,? super T3> pred)
Predicate4 equivalent to pred with an additional, ignored argument.
public static <T,U> Thunk<U> compose(Thunk<? extends T> thunk,
Lambda<? super T,? extends U> lambda)
lambda with the result of thunk.
public static <S,T,U> Lambda<S,U> compose(Lambda<? super S,? extends T> l1,
Lambda<? super T,? extends U> l2)
l2 with the result of l1.
public static <S1,S2,T,U> Lambda2<S1,S2,U> compose(Lambda2<? super S1,? super S2,? extends T> l1,
Lambda<? super T,? extends U> l2)
l2 with the result of l1.
public static <S1,S2,S3,T,U> Lambda3<S1,S2,S3,U> compose(Lambda3<? super S1,? super S2,? super S3,? extends T> l1,
Lambda<? super T,? extends U> l2)
l2 with the result of l1.
public static <S1,S2,S3,S4,T,U> Lambda4<S1,S2,S3,S4,U> compose(Lambda4<? super S1,? super S2,? super S3,? super S4,? extends T> l1,
Lambda<? super T,? extends U> l2)
l2 with the result of l1.
public static Runnable compose(Runnable... runnables)
public static Runnable compose(Iterable<? extends Runnable> runnables)
public static <T> Runnable1<T> compose(Runnable1<? super T> r1,
Runnable1<? super T> r2)
r1 followed by r2 with the same input.
public static <T> Runnable1<T> compose(Runnable1<? super T> r1,
Runnable1<? super T> r2,
Runnable1<? super T> r3)
public static <T> Runnable1<T> compose1(Iterable<? extends Runnable1<? super T>> runnables)
compose1
is used to avoid a name clash with compose(Iterable) (due to erasure).
public static <T1,T2> Runnable2<T1,T2> compose(Runnable2<? super T1,? super T2> r1,
Runnable2<? super T1,? super T2> r2)
r1 followed by r2 with the same input.
public static <T1,T2> Runnable2<T1,T2> compose(Runnable2<? super T1,? super T2> r1,
Runnable2<? super T1,? super T2> r2,
Runnable2<? super T1,? super T2> r3)
public static <T1,T2> Runnable2<T1,T2> compose2(Iterable<? extends Runnable2<? super T1,? super T2>> runnables)
compose2
is used to avoid a name clash with compose(Iterable) (due to erasure).
public static <T1,T2,T3> Runnable3<T1,T2,T3> compose(Runnable3<? super T1,? super T2,? super T3> r1,
Runnable3<? super T1,? super T2,? super T3> r2)
r1 followed by r2 with the same input.
public static <T1,T2,T3> Runnable3<T1,T2,T3> compose(Runnable3<? super T1,? super T2,? super T3> r1,
Runnable3<? super T1,? super T2,? super T3> r2,
Runnable3<? super T1,? super T2,? super T3> r3)
public static <T1,T2,T3> Runnable3<T1,T2,T3> compose3(Iterable<? extends Runnable3<? super T1,? super T2,? super T3>> runnables)
compose3
is used to avoid a name clash with compose(Iterable) (due to erasure).
public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1,
Runnable4<? super T1,? super T2,? super T3,? super T4> r2)
r1 followed by r2 with the same input.
public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1,
Runnable4<? super T1,? super T2,? super T3,? super T4> r2,
Runnable4<? super T1,? super T2,? super T3,? super T4> r3)
public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> compose4(Iterable<? extends Runnable4<? super T1,? super T2,? super T3,? super T4>> runnables)
compose4
is used to avoid a name clash with compose(Iterable) (due to erasure).
public static <T,R> Thunk<R> bindFirst(Lambda<? super T,? extends R> lambda,
T arg)
public static <T1,T2,R> Lambda<T2,R> bindFirst(Lambda2<? super T1,? super T2,? extends R> lambda,
T1 arg1)
public static <T1,T2,R> Lambda<T1,R> bindSecond(Lambda2<? super T1,? super T2,? extends R> lambda,
T2 arg2)
public static <T1,T2,T3,R> Lambda2<T2,T3,R> bindFirst(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
T1 arg1)
public static <T1,T2,T3,R> Lambda2<T1,T3,R> bindSecond(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
T2 arg2)
public static <T1,T2,T3,R> Lambda2<T1,T2,R> bindThird(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
T3 arg3)
public static <T1,T2,T3,T4,R> Lambda3<T2,T3,T4,R> bindFirst(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T1 arg1)
public static <T1,T2,T3,T4,R> Lambda3<T1,T3,T4,R> bindSecond(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T2 arg2)
public static <T1,T2,T3,T4,R> Lambda3<T1,T2,T4,R> bindThird(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T3 arg3)
public static <T1,T2,T3,T4,R> Lambda3<T1,T2,T3,R> bindFourth(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
T4 arg4)
public static <T> Condition bindFirst(Predicate<? super T> pred,
T arg)
public static <T1,T2> Predicate<T2> bindFirst(Predicate2<? super T1,? super T2> pred,
T1 arg1)
public static <T1,T2> Predicate<T1> bindSecond(Predicate2<? super T1,? super T2> pred,
T2 arg2)
public static <T1,T2,T3> Predicate2<T2,T3> bindFirst(Predicate3<? super T1,? super T2,? super T3> pred,
T1 arg1)
public static <T1,T2,T3> Predicate2<T1,T3> bindSecond(Predicate3<? super T1,? super T2,? super T3> pred,
T2 arg2)
public static <T1,T2,T3> Predicate2<T1,T2> bindThird(Predicate3<? super T1,? super T2,? super T3> pred,
T3 arg3)
public static <T1,T2,T3,T4> Predicate3<T2,T3,T4> bindFirst(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T1 arg1)
public static <T1,T2,T3,T4> Predicate3<T1,T3,T4> bindSecond(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T2 arg2)
public static <T1,T2,T3,T4> Predicate3<T1,T2,T4> bindThird(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T3 arg3)
public static <T1,T2,T3,T4> Predicate3<T1,T2,T3> bindFourth(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
T4 arg4)
public static <T> Runnable bindFirst(Runnable1<? super T> runnable,
T arg)
public static <T1,T2> Runnable1<T2> bindFirst(Runnable2<? super T1,? super T2> runnable,
T1 arg1)
public static <T1,T2> Runnable1<T1> bindSecond(Runnable2<? super T1,? super T2> runnable,
T2 arg2)
public static <T1,T2,T3> Runnable2<T2,T3> bindFirst(Runnable3<? super T1,? super T2,? super T3> runnable,
T1 arg1)
public static <T1,T2,T3> Runnable2<T1,T3> bindSecond(Runnable3<? super T1,? super T2,? super T3> runnable,
T2 arg2)
public static <T1,T2,T3> Runnable2<T1,T2> bindThird(Runnable3<? super T1,? super T2,? super T3> runnable,
T3 arg3)
public static <T1,T2,T3,T4> Runnable3<T2,T3,T4> bindFirst(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T1 arg1)
public static <T1,T2,T3,T4> Runnable3<T1,T3,T4> bindSecond(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T2 arg2)
public static <T1,T2,T3,T4> Runnable3<T1,T2,T4> bindThird(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T3 arg3)
public static <T1,T2,T3,T4> Runnable3<T1,T2,T3> bindFourth(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
T4 arg4)
public static <T1,T2,R> Lambda<T1,Lambda<T2,R>> curry(Lambda2<? super T1,? super T2,? extends R> lambda)
public static <T1,T2,T3,R> Lambda<T1,Lambda<T2,Lambda<T3,R>>> curry(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
public static <T1,T2,T3,T4,R> Lambda<T1,Lambda<T2,Lambda<T3,Lambda<T4,R>>>> curry(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
public static <T1,T2,R> Lambda2<T2,T1,R> transpose(Lambda2<? super T1,? super T2,? extends R> lambda)
public static <T1,T2> Predicate2<T2,T1> transpose(Predicate2<? super T1,? super T2> pred)
public static <T1,T2> Runnable2<T2,T1> transpose(Runnable2<? super T1,? super T2> r)
public static <T,R> Thunk<R> flatten0(Lambda<? super Null<T>,? extends R> lambda)
public static <T1,T2,R> Lambda2<T1,T2,R> flatten2(Lambda<? super Pair<T1,T2>,? extends R> lambda)
public static <T1,T2,T3,R> Lambda3<T1,T2,T3,R> flatten3(Lambda<? super Triple<T1,T2,T3>,? extends R> lambda)
public static <T1,T2,T3,T4,R> Lambda4<T1,T2,T3,T4,R> flatten4(Lambda<? super Quad<T1,T2,T3,T4>,? extends R> lambda)
public static <T> Condition flatten0(Predicate<? super Null<T>> pred)
public static <T1,T2> Predicate2<T1,T2> flatten2(Predicate<? super Pair<T1,T2>> pred)
public static <T1,T2,T3> Predicate3<T1,T2,T3> flatten3(Predicate<? super Triple<T1,T2,T3>> pred)
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> flatten4(Predicate<? super Quad<T1,T2,T3,T4>> pred)
public static <T> Runnable flatten0(Runnable1<? super Null<T>> runnable)
public static <T1,T2> Runnable2<T1,T2> flatten2(Runnable1<? super Pair<T1,T2>> runnable)
public static <T1,T2,T3> Runnable3<T1,T2,T3> flatten3(Runnable1<? super Triple<T1,T2,T3>> runnable)
public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> flatten4(Runnable1<? super Quad<T1,T2,T3,T4>> runnable)
public static <R> Lambda<Null<?>,R> unary(Thunk<? extends R> thunk)
public static <T1,T2,R> Lambda<Pair<T1,T2>,R> unary(Lambda2<? super T1,? super T2,? extends R> lambda)
public static <T1,T2,T3,R> Lambda<Triple<T1,T2,T3>,R> unary(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
public static <T1,T2,T3,T4,R> Lambda<Quad<T1,T2,T3,T4>,R> unary(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
public static Predicate<Null<?>> unary(Condition cond)
public static <T1,T2> Predicate<Pair<T1,T2>> unary(Predicate2<? super T1,? super T2> pred)
public static <T1,T2,T3> Predicate<Triple<T1,T2,T3>> unary(Predicate3<? super T1,? super T2,? super T3> pred)
public static <T1,T2,T3,T4> Predicate<Quad<T1,T2,T3,T4>> unary(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
public static Runnable1<Null<?>> unary(Runnable runnable)
public static <T1,T2> Runnable1<Pair<T1,T2>> unary(Runnable2<? super T1,? super T2> runnable)
public static <T1,T2,T3> Runnable1<Triple<T1,T2,T3>> unary(Runnable3<? super T1,? super T2,? super T3> runnable)
public static <T1,T2,T3,T4> Runnable1<Quad<T1,T2,T3,T4>> unary(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable)
public static <R> Thunk<Option<R>> wrapPartial(Thunk<? extends R> thunk,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
null and filterNull is true, or if it throws a RuntimeException
that is accepted by filterException.
public static <T,R> Lambda<T,Option<R>> wrapPartial(Lambda<? super T,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
null and filterNull is true, or if it throws a RuntimeException
that is accepted by filterException.
public static <T1,T2,R> Lambda2<T1,T2,Option<R>> wrapPartial(Lambda2<? super T1,? super T2,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
null and filterNull is true, or if it throws a
RuntimeException that is accepted by filterException.
public static <T1,T2,T3,R> Lambda3<T1,T2,T3,Option<R>> wrapPartial(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
null and filterNull is true, or if it throws a
RuntimeException that is accepted by filterException.
public static <T1,T2,T3,T4,R> Lambda4<T1,T2,T3,T4,Option<R>> wrapPartial(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
boolean filterNull,
Predicate<? super RuntimeException> filterException)
null and filterNull is true, or if it throws a
RuntimeException that is accepted by filterException.
public static <T,R> LambdaUtil.LiftedLambda<T,R> lift(Lambda<? super T,? extends R> lambda)
Option.none() in the "none" case.
public static <T1,T2,R> LambdaUtil.LiftedLambda2<T1,T2,R> lift(Lambda2<? super T1,? super T2,? extends R> lambda)
Option.none() if any argument is "none".
public static <T1,T2,T3,R> LambdaUtil.LiftedLambda3<T1,T2,T3,R> lift(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Option.none() if any argument is "none".
public static <T1,T2,T3,T4,R> LambdaUtil.LiftedLambda4<T1,T2,T3,T4,R> lift(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
Option.none() if any argument is "none".
public static Condition negate(Condition cond)
!) of cond.
public static <T> Predicate<T> negate(Predicate<? super T> pred)
!) of pred.
public static <T1,T2> Predicate2<T1,T2> negate(Predicate2<? super T1,? super T2> pred)
!) of pred.
public static <T1,T2,T3> Predicate3<T1,T2,T3> negate(Predicate3<? super T1,? super T2,? super T3> pred)
!) of pred.
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> negate(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
!) of pred.
public static Condition and(Condition c1,
Condition c2)
&&) of c1 and c2.
public static Condition and(Condition c1,
Condition c2,
Condition c3)
&&) of c1, c2, and c3.
public static Condition and0(Iterable<? extends Condition> conds)
&&) of the given conditions.
public static <T> Predicate<T> and(Predicate<? super T> p1,
Predicate<? super T> p2)
&&) of p1 and p2.
public static <T> Predicate<T> and(Predicate<? super T> p1,
Predicate<? super T> p2,
Predicate<? super T> p3)
&&) of p1, p2, and p3.
public static <T> Predicate<T> and(Iterable<? extends Predicate<? super T>> preds)
&&) of the given predicates.
public static <T1,T2> Predicate2<T1,T2> and(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2)
&&) of p1 and p2.
public static <T1,T2> Predicate2<T1,T2> and(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2,
Predicate2<? super T1,? super T2> p3)
&&) of p1, p2, and p3.
public static <T1,T2> Predicate2<T1,T2> and2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
&&) of the given predicates. The name and2 is used to avoid a name
clash with and(Iterable) (due to erasure).
public static <T1,T2,T3> Predicate3<T1,T2,T3> and(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2)
&&) of p1 and p2.
public static <T1,T2,T3> Predicate3<T1,T2,T3> and(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2,
Predicate3<? super T1,? super T2,? super T3> p3)
&&) of p1, p2, and p3.
public static <T1,T2,T3> Predicate3<T1,T2,T3> and3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
&&) of the given predicates. The name and3 is used to avoid a name
clash with and(Iterable) (due to erasure).
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
&&) of p1 and p2.
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2,
Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
&&) of p1, p2, and p3.
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> and4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
&&) of the given predicates. The name and4 is used to avoid a name
clash with and(Iterable) (due to erasure).
public static Condition or(Condition c1,
Condition c2)
||) of c1 and c2.
public static Condition or(Condition c1,
Condition c2,
Condition c3)
||) of c1, c2, and c3.
public static Condition or0(Iterable<? extends Condition> conds)
||) of the given conditions.
public static <T> Predicate<T> or(Predicate<? super T> p1,
Predicate<? super T> p2)
||) of p1 and p2.
public static <T> Predicate<T> or(Predicate<? super T> p1,
Predicate<? super T> p2,
Predicate<? super T> p3)
||) of p1, p2, and p3.
public static <T> Predicate<T> or(Iterable<? extends Predicate<? super T>> preds)
||) of the given predicates.
public static <T1,T2> Predicate2<T1,T2> or(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2)
||) of p1 and p2.
public static <T1,T2> Predicate2<T1,T2> or(Predicate2<? super T1,? super T2> p1,
Predicate2<? super T1,? super T2> p2,
Predicate2<? super T1,? super T2> p3)
||) of p1, p2, and p3.
public static <T1,T2> Predicate2<T1,T2> or2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
||) of the given predicates. The name or2 is used to avoid a name
clash with or(Iterable) (due to erasure).
public static <T1,T2,T3> Predicate3<T1,T2,T3> or(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2)
||) of p1 and p2.
public static <T1,T2,T3> Predicate3<T1,T2,T3> or(Predicate3<? super T1,? super T2,? super T3> p1,
Predicate3<? super T1,? super T2,? super T3> p2,
Predicate3<? super T1,? super T2,? super T3> p3)
||) of p1, p2, and p3.
public static <T1,T2,T3> Predicate3<T1,T2,T3> or3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
||) of the given predicates. The name or3 is used to avoid a name
clash with or(Iterable) (due to erasure).
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
||) of p1 and p2.
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
Predicate4<? super T1,? super T2,? super T3,? super T4> p2,
Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
||) of p1, p2, and p3.
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> or4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
||) of the given predicates. The name or4 is used to avoid a name
clash with or(Iterable) (due to erasure).
public static Runnable asRunnable(Thunk<?> thunk)
public static <T> Runnable1<T> asRunnable(Lambda<? super T,?> lambda)
public static <T1,T2> Runnable2<T1,T2> asRunnable(Lambda2<? super T1,? super T2,?> lambda)
public static <T1,T2,T3> Runnable3<T1,T2,T3> asRunnable(Lambda3<? super T1,? super T2,? super T3,?> lambda)
public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> asRunnable(Lambda4<? super T1,? super T2,? super T3,? super T4,?> lambda)
public static Thunk<Void> asThunk(Runnable r)
null.
public static <R> Thunk<R> asThunk(Runnable r,
R result)
result.
public static <T> Lambda<T,Void> asLambda(Runnable1<? super T> r)
null.
public static <T,R> Lambda<T,R> asLambda(Runnable1<? super T> r,
R result)
result.
public static <T1,T2> Lambda2<T1,T2,Void> asLambda(Runnable2<? super T1,? super T2> r)
null.
public static <T1,T2,R> Lambda2<T1,T2,R> asLambda(Runnable2<? super T1,? super T2> r,
R result)
result.
public static <T1,T2,T3> Lambda3<T1,T2,T3,Void> asLambda(Runnable3<? super T1,? super T2,? super T3> r)
null.
public static <T1,T2,T3,R> Lambda3<T1,T2,T3,R> asLambda(Runnable3<? super T1,? super T2,? super T3> r,
R result)
result.
public static <T1,T2,T3,T4> Lambda4<T1,T2,T3,T4,Void> asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r)
null.
public static <T1,T2,T3,T4,R> Lambda4<T1,T2,T3,T4,R> asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r,
R result)
result.
public static Condition asCondition(Thunk<? extends Boolean> thunk)
public static <T> Predicate<T> asPredicate(Lambda<? super T,? extends Boolean> lambda)
public static <T1,T2> Predicate2<T1,T2> asPredicate(Lambda2<? super T1,? super T2,? extends Boolean> lambda)
public static <T1,T2,T3> Predicate3<T1,T2,T3> asPredicate(Lambda3<? super T1,? super T2,? super T3,? extends Boolean> lambda)
public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> asPredicate(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends Boolean> lambda)
public static Thunk<Boolean> asThunk(Condition cond)
public static <T> Lambda<T,Boolean> asLambda(Predicate<? super T> predicate)
public static <T1,T2> Lambda2<T1,T2,Boolean> asLambda(Predicate2<? super T1,? super T2> predicate)
public static <T1,T2,T3> Lambda3<T1,T2,T3,Boolean> asLambda(Predicate3<? super T1,? super T2,? super T3> predicate)
public static <T1,T2,T3,T4> Lambda4<T1,T2,T3,T4,Boolean> asLambda(Predicate4<? super T1,? super T2,? super T3,? super T4> predicate)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||