net.sf.jga.fn.algorithm
public class ElementOf<T> extends AbstractBinaryPredicate<T,Collection<? extends T>> implements Serializable
Copyright © 2003 David A. Hall
Nested Class Summary | |
---|---|
interface | ElementOf.Visitor
Interface for classes that may interpret an ElementOf functor. |
Constructor Summary | |
---|---|
ElementOf()
Builds an ElementOf predicate that will use the collection's built in
contains() method. | |
ElementOf(BinaryFunctor<T,T,Boolean> eq)
Builds an ElementOf predicate that will use the given functor to
determine collection membership. |
Method Summary | |
---|---|
void | accept(Visitor v)
Calls the Visitor's visit(ElementOf) method, if it
implements the nested Visitor interface. |
BinaryFunctor<T,T,Boolean> | getComparisonFn()
Returns the (possibly null) functor used to compare a value to the
contents of a collection. |
boolean | p(T value, Collection<? extends T> collection)
Return true if the given value is an element of the collection |
String | toString() |
visit(ElementOf)
method, if it
implements the nested Visitor interface.