|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.functors.AnyPredicate
public final class AnyPredicate
Predicate implementation that returns true if any of the predicates return true. If the array of predicates is empty, then this predicate returns false.
NOTE: In versions prior to 3.2 an array size of zero or one threw an exception.
Constructor Summary | |
---|---|
AnyPredicate(Predicate[] predicates)
Constructor that performs no validation. |
Method Summary | |
---|---|
boolean |
evaluate(java.lang.Object object)
Evaluates the predicate returning true if any predicate returns true. |
static Predicate |
getInstance(java.util.Collection predicates)
Factory to create the predicate. |
static Predicate |
getInstance(Predicate[] predicates)
Factory to create the predicate. |
Predicate[] |
getPredicates()
Gets the predicates, do not modify the array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnyPredicate(Predicate[] predicates)
getInstance
if you want that.
predicates
- the predicates to check, not cloned, not nullMethod Detail |
---|
public static Predicate getInstance(Predicate[] predicates)
If the array is size zero, the predicate always returns false. If the array is size one, then that predicate is returned.
predicates
- the predicates to check, cloned, not null
any
predicate
java.lang.IllegalArgumentException
- if the predicates array is null
java.lang.IllegalArgumentException
- if any predicate in the array is nullpublic static Predicate getInstance(java.util.Collection predicates)
If the collection is size zero, the predicate always returns false. If the collection is size one, then that predicate is returned.
predicates
- the predicates to check, cloned, not null
all
predicate
java.lang.IllegalArgumentException
- if the predicates array is null
java.lang.IllegalArgumentException
- if any predicate in the array is nullpublic boolean evaluate(java.lang.Object object)
evaluate
in interface Predicate
object
- the input object
public Predicate[] getPredicates()
getPredicates
in interface PredicateDecorator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |