| net.sf.jga.fn.algorithm.FindElement
FindElement | public class FindElement extends FindIteratorFunctor (Code) | | Locates values from a given collection in an iteration.
To Serialize a FindElement, the generic parameter T must be serializable.
Copyright © 2003-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | FindElement(Collection<? extends T> elements) Builds a FindElement functor that locates values in the given collection
using the contains() method. | public | FindElement(Collection<? extends T> elements, BinaryFunctor<T, T, Boolean> eq) Builds a FindElement functor that locates values in the given collection
using the given functor. |
Method Summary | |
public void | accept(net.sf.jga.fn.Visitor v) Calls the Visitor's visit(FindElement) method, if it
implements the nested Visitor interface. | public FindIterator<T> | fn(Iterator<? extends T> iterator) Finds the first/next element in the iteration that is an element of the
given collection.
an iterator whose next() [if it hasNext()] points to the nextelement in the iteration that is an element of the given collection. | public BinaryFunctor<T, T, Boolean> | getComparisonFn() Returns the (possibly null) functor used to compare a value to the
contents of the given collection. | public Collection<? extends T> | getElementSet() Returns the set of values being sought. | public String | toString() |
serialVersionUID | final static long serialVersionUID(Code) | | |
FindElement | public FindElement(Collection<? extends T> elements)(Code) | | Builds a FindElement functor that locates values in the given collection
using the contains() method.
|
FindElement | public FindElement(Collection<? extends T> elements, BinaryFunctor<T, T, Boolean> eq)(Code) | | Builds a FindElement functor that locates values in the given collection
using the given functor. The functor is expected to compare two values
and return TRUE if they are determined to be equal.
|
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(FindElement) method, if it
implements the nested Visitor interface.
|
fn | public FindIterator<T> fn(Iterator<? extends T> iterator)(Code) | | Finds the first/next element in the iteration that is an element of the
given collection.
an iterator whose next() [if it hasNext()] points to the nextelement in the iteration that is an element of the given collection. Ifno such element exists, then the returned iterator's hasNext() will befalse. |
getComparisonFn | public BinaryFunctor<T, T, Boolean> getComparisonFn()(Code) | | Returns the (possibly null) functor used to compare a value to the
contents of the given collection.
|
getElementSet | public Collection<? extends T> getElementSet()(Code) | | Returns the set of values being sought.
|
|
|