| net.sf.jga.fn.adaptor.ComposeBinary
All known Subclasses: net.sf.jga.fn.AdaptorVisitor,
ComposeBinary | public class ComposeBinary extends BinaryFunctor (Code) | | Binary Functor that passes the results of two inner Binary Functors as the
arguments to an outer Binary Functor. This allows for the construction of
compound functors from the primitives found in the arithmetic, logical,
property, and comparison packages.
Copyright © 2002-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | ComposeBinary(BinaryFunctor<T1, T2, F1> f, BinaryFunctor<T1, T2, F2> g, BinaryFunctor<F1, F2, R> h) Builds a ComposeBinary functor, given two inner functors f and
g, and outer functor h. |
Method Summary | |
public void | accept(net.sf.jga.fn.Visitor v) Calls the Visitor's visit(ComposeBinary) method, if it
implements the nested Visitor interface. | public R | fn(T1 x, T2 y) Given argument x, passes x to both inner functors, and passes the
results of those functors to the outer functor. | public BinaryFunctor<T1, T2, F1> | getFirstInnerFunctor() | public BinaryFunctor<F1, F2, R> | getOuterFunctor() | public BinaryFunctor<T1, T2, F2> | getSecondInnerFunctor() | public String | toString() |
serialVersionUID | final static long serialVersionUID(Code) | | |
ComposeBinary | public ComposeBinary(BinaryFunctor<T1, T2, F1> f, BinaryFunctor<T1, T2, F2> g, BinaryFunctor<F1, F2, R> h)(Code) | | Builds a ComposeBinary functor, given two inner functors f and
g, and outer functor h.
throws: IllegalArgumentException - if any of the functors is missing |
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(ComposeBinary) method, if it
implements the nested Visitor interface.
|
fn | public R fn(T1 x, T2 y)(Code) | | Given argument x, passes x to both inner functors, and passes the
results of those functors to the outer functor.
h(f(x,y), g(x,y)) |
getFirstInnerFunctor | public BinaryFunctor<T1, T2, F1> getFirstInnerFunctor()(Code) | | Returns the first of two inner functors
the first of two inner functors |
getOuterFunctor | public BinaryFunctor<F1, F2, R> getOuterFunctor()(Code) | | Returns the outer functor
the outer functor |
getSecondInnerFunctor | public BinaryFunctor<T1, T2, F2> getSecondInnerFunctor()(Code) | | Returns the second of two inner functors
the second of two inner functors |
|
|