net.sf.jga.fn.adaptor
public class ChainBinary<T1,T2,F,R> extends AbstractBinaryFunctor<T1,T2,R> implements Serializable
Copyright © 2002 David A. Hall
Nested Class Summary | |
---|---|
interface | ChainBinary.Visitor
Interface for classes that may interpret a ChainBinary functor. |
Constructor Summary | |
---|---|
ChainBinary(UnaryFunctor<F,R> f, BinaryFunctor<T1,T2,F> g)
Builds a ChainBinary functor, given inner functors f and outer
functor g. |
Method Summary | |
---|---|
void | accept(Visitor v)
Calls the Visitor's visit(ChainBinary) method, if it
implements the nested Visitor interface. |
R | fn(T1 x, T2 y)
Passes arguments x and y to the inner functor, and passes
the result to the outer functor.
|
BinaryFunctor<T1,T2,F> | getOuter()
Returns the inner functor |
UnaryFunctor<F,R> | getOuterFn()
Returns the outer functor |
String | toString() |
Throws: IllegalArgumentException if any of the functors is missing
visit(ChainBinary)
method, if it
implements the nested Visitor interface.Returns: f(g(x,y))
Returns: the inner functor
Returns: the outer functor