|
|||||||||
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.UnaryFunctor<T1,R> net.sf.jga.fn.adaptor.Bind2nd<T1,T2,R>
public class Bind2nd<T1,T2,R>
UnaryFunctor that wraps a given BinaryFunctor, passing a constant value as the second argument of the child functor. The runtime argument is passed as the first argument of the child functor.
Copyright © 2003-2005 David A. Hall
Nested Class Summary | |
---|---|
static interface |
Bind2nd.Visitor
Interface for classes that may interpret an Bind2nd functor. |
Constructor Summary | |
---|---|
Bind2nd(T2 constant,
BinaryFunctor<T1,T2,R> fn)
Builds a Bind2nd 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> |
getFunctor()
Returns the child functor for this functor |
java.lang.String |
toString()
|
Methods inherited from class net.sf.jga.fn.UnaryFunctor |
---|
bind, bind0th, bindNth, compose, compose, compose, composeNth, composeNth, eval, generate, generateNth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Bind2nd(T2 constant, BinaryFunctor<T1,T2,R> fn)
java.lang.IllegalArgumentException
- if the functor is null.Method Detail |
---|
public BinaryFunctor<T1,T2,R> getFunctor()
public T2 getConstant()
public R fn(T1 x)
fn
in class UnaryFunctor<T1,R>
public void accept(Visitor v)
visit(Bind2nd)
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 |