|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.fn.Functor<R> net.sf.jga.fn.Generator<R> net.sf.jga.fn.adaptor.Generate<T,R>
public class Generate<T,R>
Generator that wraps a UnaryFunctor around a nested Generator. The values produced by the nested generator are passed to the functor, and the results returned to the caller.
Copyright © 2004-2005 David A. Hall
Nested Class Summary | |
---|---|
static interface |
Generate.Visitor
Interface for classes that may interpret a Generate functor. |
Constructor Summary | |
---|---|
Generate(UnaryFunctor<T,R> fn,
Generator<T> gen)
|
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(Generate) method, if it
implements the nested Visitor interface. |
R |
fn()
Returns the results of the nested generator as modified by the functor. |
UnaryFunctor<T,R> |
getFunctor()
Returns the UnaryFunctor that is applied to values returned by the nested Generator. |
Generator<T> |
getGenerator()
Returns the nested Generator; |
java.lang.String |
toString()
|
Methods inherited from class net.sf.jga.fn.Generator |
---|
bind0th, bindNth, eval |
Methods inherited from class net.sf.jga.fn.Functor |
---|
composeNth, composeNth, generateNth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Generate(UnaryFunctor<T,R> fn, Generator<T> gen)
Method Detail |
---|
public UnaryFunctor<T,R> getFunctor()
public Generator<T> getGenerator()
public R fn()
fn
in class Generator<R>
public void accept(Visitor v)
visit(Generate)
method, if it
implements the nested Visitor interface.
accept
in interface Visitable
accept
in class Functor<R>
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 |