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