net.sf.jga.fn.adaptor
public class Bind2nd<T1,T2,R> extends AbstractUnaryFunctor<T1,R> implements Serializable
Copyright © 2003 David A. Hall
Nested Class Summary | |
---|---|
interface | Bind2nd.Visitor
Interface for classes that may interpret an Bind2nd functor. |
Constructor Summary | |
---|---|
Bind2nd(T2 constant, BinaryFunctor<T1,T2,R> fn)
Builds a Bind1st Functor with the given contant and child functor. |
Method Summary | |
---|---|
void | accept(Visitor v)
Calls the Visitor's visit(Bind2nd) method, if it
implements the nested Visitor interface. |
R | fn(T1 x)
Given one argument, passes the argument and the constant value to the
child functor and returns the result.
|
T2 | getConstant()
Returns the constant value |
BinaryFunctor<T1,T2,R> | getFunction()
Returns the child functor for this functor |
String | toString() |
Throws: IllegalArgumentException if the functor is null.
visit(Bind2nd)
method, if it
implements the nested Visitor interface.Returns: f(x,c)
Returns: the constant value
Returns: the child functor for this functor