A - the predicate argument type.public final class CompositeUnaryPredicate<A> extends Object implements UnaryPredicate<A>, Serializable
UnaryPredicate
representing the composition of
UnaryFunctions,
"chaining" the output of one to the input
of another. For example,
new CompositeUnaryPredicate(p).of(f)
tests to
p.test(f.evaluate(obj)), and
new CompositeUnaryPredicate(p).of(f).of(g)
tests to
p.test(f.evaluate(g.evaluate(obj))).
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 |
|---|
CompositeUnaryPredicate(UnaryPredicate<? super A> predicate)
Create a new CompositeUnaryPredicate.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(CompositeUnaryPredicate<?> that)
Learn whether another CompositeUnaryPredicate is equal to this.
|
boolean |
equals(Object that) |
int |
hashCode() |
<P> CompositeUnaryPredicate<P> |
of(UnaryFunction<? super P,? extends A> preceding)
Fluently obtain a CompositeUnaryPredicate that applies our predicate to the result of the preceding function.
|
boolean |
test(A obj)
Evaluate this predicate.
|
String |
toString() |
public CompositeUnaryPredicate(UnaryPredicate<? super A> predicate)
predicate - UnaryPredicate against which the composite functions' output will be testedpublic <P> CompositeUnaryPredicate<P> of(UnaryFunction<? super P,? extends A> preceding)
P - the input function left argument and output predicate argument typespreceding - UnaryFunctionpublic boolean test(A obj)
test in interface UnaryPredicate<A>obj - the A object to testpublic boolean equals(CompositeUnaryPredicate<?> that)
that - CompositeUnaryPredicate to testCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.