| net.sf.jga.fn.algorithm.ElementOf
ElementOf | public class ElementOf extends BinaryPredicate> (Code) | | BinaryPredicate that returns true if a given value is an element of a
given collection.
Copyright © 2003-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | ElementOf() Builds an ElementOf predicate that will use the collection's built in
contains() method. | public | ElementOf(BinaryFunctor<T, T, Boolean> eq) Builds an ElementOf predicate that will use the given functor to
determine collection membership. |
serialVersionUID | final static long serialVersionUID(Code) | | |
ElementOf | public ElementOf()(Code) | | Builds an ElementOf predicate that will use the collection's built in
contains() method. This form is potentially more efficient than the
other constructed form, if the collection passed at evaluation
implements contains() using an algorithm more efficient than a linear
search.
|
ElementOf | public ElementOf(BinaryFunctor<T, T, Boolean> eq)(Code) | | Builds an ElementOf predicate that will use the given functor to
determine collection membership. The collection will be searched
sequentially for the first element for which the functor returns true.
|
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(ElementOf) method, if it
implements the nested Visitor interface.
|
fn | public Boolean fn(T value, Collection<? extends T> collection)(Code) | | Return true if the given value is an element of the collection
|
getComparisonFn | public BinaryFunctor<T, T, Boolean> getComparisonFn()(Code) | | Returns the (possibly null) functor used to compare a value to the
contents of a collection.
|
|
|