|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.functors.AndPredicate<T>
public final class AndPredicate<T>
Predicate implementation that returns true if both the predicates return true.
Constructor Summary | |
---|---|
AndPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2)
Constructor that performs no validation. |
Method Summary | ||
---|---|---|
boolean |
evaluate(T object)
Evaluates the predicate returning true if both predicates return true. |
|
static
|
getInstance(Predicate<? super T> predicate1,
Predicate<? super T> predicate2)
Factory to create the predicate. |
|
Predicate<? super T>[] |
getPredicates()
Gets the two predicates being decorated as an array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AndPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2)
getInstance
if you want that.
predicate1
- the first predicate to check, not nullpredicate2
- the second predicate to check, not nullMethod Detail |
---|
public static <T> Predicate<T> getInstance(Predicate<? super T> predicate1, Predicate<? super T> predicate2)
predicate1
- the first predicate to check, not nullpredicate2
- the second predicate to check, not null
and
predicate
IllegalArgumentException
- if either predicate is nullpublic boolean evaluate(T object)
evaluate
in interface Predicate<T>
object
- the input object
public Predicate<? super T>[] getPredicates()
getPredicates
in interface PredicateDecorator<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |