|
|||||||||
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.UnaryFunctor<T1,R> net.sf.jga.fn.adaptor.Generate2nd<T1,T2,R>
public class Generate2nd<T1,T2,R>
UnaryFunctor that uses a Generator to produce the 2nd argument to a given BinaryFunctor.
Copyright © 2004-2005 David A. Hall
Nested Class Summary | |
---|---|
static interface |
Generate2nd.Visitor
Interface for classes that may interpret a Generate2nd functor. |
Constructor Summary | |
---|---|
Generate2nd(BinaryFunctor<T1,T2,R> fn,
Generator<T2> gen)
|
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(Generate2nd) method, if it
implements the nested Visitor interface. |
R |
fn(T1 arg)
Returns the results of the functor, using the nested generator to produce the first argument. |
BinaryFunctor<T1,T2,R> |
getFunctor()
Returns the Functor that is invoked |
Generator<T2> |
getGenerator()
Returns the generator that produces the 2nd argument. |
java.lang.String |
toString()
|
Methods inherited from class net.sf.jga.fn.UnaryFunctor |
---|
bind, bind0th, bindNth, compose, compose, compose, composeNth, composeNth, eval, generate, generateNth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Generate2nd(BinaryFunctor<T1,T2,R> fn, Generator<T2> gen)
Method Detail |
---|
public BinaryFunctor<T1,T2,R> getFunctor()
public Generator<T2> getGenerator()
public R fn(T1 arg)
fn
in class UnaryFunctor<T1,R>
public void accept(Visitor v)
visit(Generate2nd)
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 |