|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jga.fn.UnaryFunctor<java.util.Iterator<? extends T>,FindIterator<T>>
net.sf.jga.fn.algorithm.FindIteratorFunctor<T>
net.sf.jga.fn.algorithm.FindElement<T>
public class FindElement<T>
Locates values from a given collection in an iteration.
To Serialize a FindElement, the generic parameter T must be serializable.
Copyright © 2003 David A. Hall
| Nested Class Summary | |
|---|---|
static interface |
FindElement.Visitor
Interface for classes that may interpret a FindElement functor |
| Constructor Summary | |
|---|---|
FindElement(java.util.Collection<? extends T> elements)
Builds a FindElement functor that locates values in the given collection using the contains() method. |
|
FindElement(java.util.Collection<? extends T> elements,
BinaryFunctor<T,T,java.lang.Boolean> eq)
Builds a FindElement functor that locates values in the given collection using the given functor. |
|
| Method Summary | |
|---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(FindElement) method, if it
implements the nested Visitor interface. |
FindIterator<T> |
fn(java.util.Iterator<? extends T> iterator)
Finds the first/next element in the iteration that is an element of the given collection. |
BinaryFunctor<T,T,java.lang.Boolean> |
getComparisonFn()
Returns the (possibly null) functor used to compare a value to the contents of the given collection. |
java.util.Collection<? extends T> |
getElementSet()
Returns the set of values being sought. |
java.lang.String |
toString()
|
| Methods inherited from class net.sf.jga.fn.algorithm.FindIteratorFunctor |
|---|
wrap |
| Methods inherited from class net.sf.jga.fn.UnaryFunctor |
|---|
bind, compose, compose, generate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FindElement(java.util.Collection<? extends T> elements)
public FindElement(java.util.Collection<? extends T> elements,
BinaryFunctor<T,T,java.lang.Boolean> eq)
| Method Detail |
|---|
public java.util.Collection<? extends T> getElementSet()
public BinaryFunctor<T,T,java.lang.Boolean> getComparisonFn()
public FindIterator<T> fn(java.util.Iterator<? extends T> iterator)
fn in class UnaryFunctor<java.util.Iterator<? extends T>,FindIterator<T>>public void accept(Visitor v)
visit(FindElement) method, if it
implements the nested Visitor interface.
accept in interface Visitableaccept in class UnaryFunctor<java.util.Iterator<? extends T>,FindIterator<T>>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 | ||||||||