A - the predicate argument type.public final class UnaryOr<A> extends Object
Tests true iff
at least one of its children test true.
Note that by this definition, the "or" of
an empty collection of predicates tests false.
Note that although this class implements
Serializable, a given instance will
only be truly Serializable if all the
underlying functors are. Attempts to serialize
an instance whose delegates are not all
Serializable will result in an exception.
| Constructor and Description |
|---|
UnaryOr()
Create a new UnaryOr.
|
UnaryOr(Iterable<UnaryPredicate<? super A>> predicates)
Create a new UnaryOr instance.
|
UnaryOr(UnaryPredicate<? super A>... predicates)
Create a new UnaryOr instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addUnaryPredicate(UnaryPredicate<? super A> p)
Add a UnaryPredicate to the list.
|
boolean |
equals(Object that) |
boolean |
equals(UnaryOr<?> that)
Learn whether another UnaryOr is equal to this.
|
protected List<UnaryPredicate<? super A>> |
getUnaryPredicateList()
Get the "live" list of contained
UnaryPredicates. |
protected boolean |
getUnaryPredicateListEquals(org.apache.commons.functor.core.composite.BaseUnaryPredicateList<?> that)
Learn whether another BaseUnaryPredicateList has content equal to this.
|
protected int |
getUnaryPredicateListHashCode()
Get a hashCode for the list.
|
protected String |
getUnaryPredicateListToString()
Get a toString for the list.
|
int |
hashCode() |
UnaryOr<A> |
or(UnaryPredicate<? super A> p)
Fluently add a Predicate.
|
boolean |
test(A a)
Evaluate this predicate.
|
String |
toString() |
public UnaryOr()
public UnaryOr(Iterable<UnaryPredicate<? super A>> predicates)
predicates - the predicates to put in unary or.public UnaryOr(UnaryPredicate<? super A>... predicates)
predicates - the predicates to put in unary or.public UnaryOr<A> or(UnaryPredicate<? super A> p)
p - Predicate to addpublic boolean test(A a)
a - the A object to testpublic boolean equals(UnaryOr<?> that)
that - UnaryOr to testpublic int hashCode()
protected void addUnaryPredicate(UnaryPredicate<? super A> p)
p - UnaryPredicate to addprotected List<UnaryPredicate<? super A>> getUnaryPredicateList()
UnaryPredicates.protected boolean getUnaryPredicateListEquals(org.apache.commons.functor.core.composite.BaseUnaryPredicateList<?> that)
that - the BaseUnaryPredicateList to testprotected int getUnaryPredicateListHashCode()
protected String getUnaryPredicateListToString()
Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.