|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jga.fn.Functor<R>
net.sf.jga.fn.BinaryFunctor<T,java.util.Collection<? extends T>,java.lang.Boolean>
net.sf.jga.fn.algorithm.ElementOf<T>
public class ElementOf<T>
BinaryPredicate that returns true if a given value is an element of a given collection.
Copyright © 2003-2005 David A. Hall
| Nested Class Summary | |
|---|---|
static 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,java.lang.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. |
java.lang.Boolean |
fn(T value,
java.util.Collection<? extends T> collection)
Return true if the given value is an element of the collection |
BinaryFunctor<T,T,java.lang.Boolean> |
getComparisonFn()
Returns the (possibly null) functor used to compare a value to the contents of a collection. |
java.lang.String |
toString()
|
| Methods inherited from class net.sf.jga.fn.BinaryFunctor |
|---|
bind, bind0th, bind1st, bind2nd, bindNth, compose, compose, composeNth, distribute, eval, generate, generate1st, generate2nd, generateNth |
| Methods inherited from class net.sf.jga.fn.Functor |
|---|
composeNth |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ElementOf()
public ElementOf(BinaryFunctor<T,T,java.lang.Boolean> eq)
| Method Detail |
|---|
public BinaryFunctor<T,T,java.lang.Boolean> getComparisonFn()
public java.lang.Boolean fn(T value,
java.util.Collection<? extends T> collection)
fn in class BinaryFunctor<T,java.util.Collection<? extends T>,java.lang.Boolean>public void accept(Visitor v)
visit(ElementOf) method, if it
implements the nested Visitor interface.
accept in interface Visitableaccept in class Functor<java.lang.Boolean>public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||