|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.collections15.functors.predicate.AbstractMultplePredicateDecorator<E> net.sf.collections15.functors.predicate.OnePredicate<E>
public final class OnePredicate<E>
Predicate
implementation that returns true
if
exactly one decorated Predicate
s return true
.
Field Summary |
---|
Fields inherited from class net.sf.collections15.functors.predicate.AbstractMultplePredicateDecorator |
---|
decoratedPredicates |
Constructor Summary | |
---|---|
protected |
OnePredicate(java.util.Collection<Predicate<? super E>> predicates)
Creates a new instance that wraps the specified collection of Predicate s. |
Method Summary | ||
---|---|---|
boolean |
evaluate(E object)
Evaluates the Predicate returning true exactly
one of the decorated Predicate s returns true . |
|
static
|
getInstance(java.util.Collection<Predicate<? super T>> predicates)
Returns an instance that wraps the specified collection of Predicate s. |
Methods inherited from class net.sf.collections15.functors.predicate.AbstractMultplePredicateDecorator |
---|
getDecoratedPredicates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected OnePredicate(java.util.Collection<Predicate<? super E>> predicates)
Predicate
s.
predicates
- The java.lang.IllegalArgumentException
- Thrown if the collection, or any of its
elements are null
. The
collection may be empty, however, in
which case the resulting AnyPredicate
will always return false
.Method Detail |
---|
public static <T> OnePredicate<T> getInstance(java.util.Collection<Predicate<? super T>> predicates)
Predicate
s.
predicates
- The Predicate
instance that will only evaluate to
true
if exactly one of the wrapped
Predicate
s evaluates to true
.
java.lang.IllegalArgumentException
- Thrown if the collection, or any of its
elements are null
. The
collection may be empty, however, in
which case the resulting AnyPredicate
will always return false
.public boolean evaluate(E object)
Predicate
returning true
exactly
one of the decorated Predicate
s returns true
.
object
- The input object to evaluate.
true
if exactly one of the decorated
Predicate
s returns true
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |