| net.sf.jga.fn.UnaryFunctor
UnaryFunctor | abstract public class UnaryFunctor extends Functor implements Serializable,Visitable(Code) | | A Function Object that takes one argument and returns a result. The
argument is of type T , and the result is of type R .
Copyright © 2002-2005 David A. Hall
author: David A. Hall |
Method Summary | |
public void | accept(Visitor v) No-op implementation of Visitable interface. | public Generator<R> | bind(T val) FactoryMethod that binds the argument arguments to this function to a specific
value. | public UnaryFunctor<F, R> | compose(UnaryFunctor<F, T> f) FactoryMethod that creates a UnaryFunctor that passes its argument to
the given functor, and uses the result as the argument to this
function. | public BinaryFunctor<F1, F2, R> | compose(BinaryFunctor<F1, F2, T> f) FactoryMethod that creates a BinaryFunctor that passes its arguments to
the given functor, and uses the result as the argument to this
function. | public R | eval(Object... args) Executes the function and returns the result. | abstract public R | fn(T arg) Executes the function and returns the result. | public Generator<R> | generate(Generator<T> gen) FactoryMethod that creates a Generator to create the argument to this
function. |
accept | public void accept(Visitor v)(Code) | | No-op implementation of Visitable interface.
|
bind | public Generator<R> bind(T val)(Code) | | FactoryMethod that binds the argument arguments to this function to a specific
value. The new functor will return
fnthis(val) .
|
compose | public UnaryFunctor<F, R> compose(UnaryFunctor<F, T> f)(Code) | | FactoryMethod that creates a UnaryFunctor that passes its argument to
the given functor, and uses the result as the argument to this
function. Given argument x, the new functor will return
fnthis(f(x)))
|
compose | public BinaryFunctor<F1, F2, R> compose(BinaryFunctor<F1, F2, T> f)(Code) | | FactoryMethod that creates a BinaryFunctor that passes its arguments to
the given functor, and uses the result as the argument to this
function. Given arguments x and y, the new functor will
return fnthis(f(x,y)))
|
eval | public R eval(Object... args)(Code) | | Executes the function and returns the result.
|
fn | abstract public R fn(T arg)(Code) | | Executes the function and returns the result.
|
generate | public Generator<R> generate(Generator<T> gen)(Code) | | FactoryMethod that creates a Generator to create the argument to this
function. The new functor will return
fnthis(gen()) .
|
|
|