|
|||||||||
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.adaptor.ChainFunctor<F,R>
public class ChainFunctor<F,R>
Functor that passes the results of a nested Functor as the argument to a UnaryFunctor.
Copyright © 2009 David A. Hall
Nested Class Summary | |
---|---|
static interface |
ChainFunctor.Visitor
Interface for classes that may interpret a ChainBinary functor. |
Constructor Summary | |
---|---|
ChainFunctor(UnaryFunctor<F,R> f,
Functor<F> g)
Builds a ChainBinary functor, given outer functor f and inner functor g. |
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(ChainBinary) method, if it
implements the nested Visitor interface. |
R |
eval(java.lang.Object... args)
Passes arguments x and y to the inner functor, and passes the result to the outer functor. |
Functor<F> |
getInnerFunctor()
Returns the inner functor |
UnaryFunctor<F,R> |
getOuterFunctor()
Returns the outer functor |
java.lang.String |
toString()
|
Methods inherited from class net.sf.jga.fn.Functor |
---|
bind0th, bindNth, composeNth, composeNth, generateNth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChainFunctor(UnaryFunctor<F,R> f, Functor<F> g)
java.lang.IllegalArgumentException
- if any of the functors is missingMethod Detail |
---|
public UnaryFunctor<F,R> getOuterFunctor()
public Functor<F> getInnerFunctor()
public R eval(java.lang.Object... args)
eval
in class Functor<R>
public void accept(Visitor v)
visit(ChainBinary)
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 |