net.sf.jga.fn.algorithm
public class ForEach<T,R> extends AbstractUnaryFunctor<Iterator<? extends T>,R> implements Serializable
Copyright © 2003 David A. Hall
Nested Class Summary | |
---|---|
interface | ForEach.Visitor
Interface for classes that may interpret an ForEach functor. |
Constructor Summary | |
---|---|
ForEach(UnaryFunctor<T,R> fn)
Builds a ForEach functor that will use the given functor to process
elements in an iteration. |
Method Summary | |
---|---|
void | accept(Visitor v)
Calls the Visitor's visit(ForEach) method, if it
implements the nested Visitor interface. |
R | fn(Iterator<? extends T> iterator)
Apply the functor to each element in the iteration and return the final
result. |
UnaryFunctor<T,R> | getFunction()
Returns the functor used to process elements in an iteration. |
String | toString() |
Throws: IllegalArgumentException if the functor is null
visit(ForEach)
method, if it
implements the nested Visitor interface.UNKNOWN: the result of the last execution of the functor, or null if the functor is not executed.