|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.co.jezuk.mango.Predicates
public class Predicates
The Mango Library Unary Predicates
A is a special form of a PredicateFunction,
whose result represents the truth or otherwise of some condition.
Returns true if the condition the Predicate tests for
is satisfied, false otherwise.
Predicate| Method Summary | ||
|---|---|---|
static
|
All(java.util.Collection<Predicate<T>> preds)
|
|
static
|
All(java.util.Iterator<Predicate<T>> preds)
|
|
static
|
All(java.lang.Object... preds)
A Predicate which returns true if all of the supplied Predicates are true. |
|
static
|
And(Predicate<T> pred1,
Predicate<T> pred2)
A Predicate which returns the logical AND of two other Predicate. |
|
static
|
Any(java.util.Collection<Predicate<T>> preds)
|
|
static
|
Any(java.util.Iterator<Predicate<T>> preds)
|
|
static
|
Any(java.lang.Object... preds)
A Predicate which returns true if any one of the supplied Predicates are true. |
|
static
|
Constant(boolean constant)
A Predicate which returns a precomputed constant value |
|
static
|
False()
A Predicate which always returns false |
|
static
|
IsNull()
A Predicate which checks whether the passed object
reference is null. |
|
static
|
Nand(Predicate<T> pred1,
Predicate<T> pred2)
A Predicate which returns the logical NAND of two other Predicate. |
|
static
|
Nor(Predicate<T> pred1,
Predicate<T> pred2)
A Predicate which returns the logical NOR of two other Predicate. |
|
static
|
Not(Predicate<T> pred)
A Predicate which is the logical negation of some other Predicate. |
|
static
|
NotNull()
A Predicate which checks whether the passed object
reference is not null. |
|
static
|
OneOf(java.util.Collection<Predicate<T>> preds)
|
|
static
|
OneOf(java.util.Iterator<Predicate<T>> preds)
|
|
static
|
OneOf(java.lang.Object... preds)
A Predicate which returns true if only one of the supplied Predicates is true. |
|
static
|
Or(Predicate<T> pred1,
Predicate<T> pred2)
A Predicate which returns the logical OR of two other Predicate. |
|
static
|
True()
A Predicate which always returns true |
|
static
|
Xnor(Predicate<T> pred1,
Predicate<T> pred2)
A Predicate which returns the logical XNOR of two other Predicate. |
|
static
|
Xor(Predicate<T> pred1,
Predicate<T> pred2)
A Predicate which returns the logical XOR of two other Predicate. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> Predicate<T> True()
Predicate which always returns true
public static <T> Predicate<T> False()
Predicate which always returns false
public static <T> Predicate<T> Constant(boolean constant)
Predicate which returns a precomputed constant value
public static <T> Predicate<T> Not(Predicate<T> pred)
Predicate which is the logical negation of some other Predicate. If n
is a Not object, and pred is the Predicate it was constructed with,
then n.test(x) returns !pred.test(x).
public static <T> Predicate<T> And(Predicate<T> pred1,
Predicate<T> pred2)
Predicate which returns the logical AND of two other Predicate. If a
is an And object, constructed with pred1 and pred2, then
a.test(x) returns pred1.test(x) && pred2.test(x)
public static <T> Predicate<T> Or(Predicate<T> pred1,
Predicate<T> pred2)
Predicate which returns the logical OR of two other Predicate. If a
is an Or object, constructed with pred1 and pred2, then
a.test(x) returns pred1.test(x) || pred2.test(x)
public static <T> Predicate<T> Xor(Predicate<T> pred1,
Predicate<T> pred2)
Predicate which returns the logical XOR of two other Predicate.
public static <T> Predicate<T> Nand(Predicate<T> pred1,
Predicate<T> pred2)
Predicate which returns the logical NAND of two other Predicate. If a
is an Nand object, constructed with pred1 and pred2, then
a.test(x) returns !(pred1.test(x) && pred2.test(x))
public static <T> Predicate<T> Nor(Predicate<T> pred1,
Predicate<T> pred2)
Predicate which returns the logical NOR of two other Predicate. If a
is an Nor object, constructed with pred1 and pred2, then
a.test(x) returns !(pred1.test(x) || pred2.test(x))
public static <T> Predicate<T> Xnor(Predicate<T> pred1,
Predicate<T> pred2)
Predicate which returns the logical XNOR of two other Predicate.
public static <T> Predicate<T> All(java.lang.Object... preds)
Predicate which returns true if all of the supplied Predicates are true. It is an AND generalised to any number of arguments. The Predicates are evaluated in the order supplied. Evaluation is short circuited as soon as a predicate fails.
public static <T> Predicate<T> All(java.util.Collection<Predicate<T>> preds)
public static <T> Predicate<T> All(java.util.Iterator<Predicate<T>> preds)
public static <T> Predicate<T> Any(java.lang.Object... preds)
Predicate which returns true if any one of the supplied Predicates are true. It is an OR generalised to any number of arguments. The Predicates are evaluated in the order supplied. Evaluation short circuits as soon as a predicate returns true.
public static <T> Predicate<T> Any(java.util.Collection<Predicate<T>> preds)
public static <T> Predicate<T> Any(java.util.Iterator<Predicate<T>> preds)
public static <T> Predicate<T> OneOf(java.lang.Object... preds)
Predicate which returns true if only one of the supplied Predicates is true. The Predicates are evaluated in the order supplied. Execution will short circuit as soon as more than one Predicate has returned true.
public static <T> Predicate<T> OneOf(java.util.Collection<Predicate<T>> preds)
public static <T> Predicate<T> OneOf(java.util.Iterator<Predicate<T>> preds)
public static <T> Predicate<T> IsNull()
Predicate which checks whether the passed object
reference is null.
public static <T> Predicate<T> NotNull()
Predicate which checks whether the passed object
reference is not null.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||