|
|||||||||
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<T,R>
public abstract class UnaryFunctor<T,R>
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
Constructor Summary | |
---|---|
UnaryFunctor()
|
Method Summary | ||
---|---|---|
Generator<R> |
bind(T val)
FactoryMethod that binds the argument arguments to this function to a specific value. |
|
Functor<R> |
bind0th(java.lang.Object arg0,
java.lang.Object... args)
Binds the given values to this functor, starting from the first argument. |
|
Functor<R> |
bindNth(int idx,
java.lang.Object arg0,
java.lang.Object... args)
Binds the given values to this functor, starting from the given index. |
|
|
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. |
|
Functor<R> |
compose(Functor<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. |
|
|
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. |
|
Functor<R> |
composeNth(int idx,
BinaryFunctor<?,?,?> bf)
Computes the argument at the given index from the pair of arguments starting at the given index |
|
Functor<R> |
composeNth(int idx,
UnaryFunctor<?,?> uf)
Modifies the argument at the given index to this functor |
|
R |
eval(java.lang.Object... args)
Executes the function and returns the result. |
|
abstract R |
fn(T arg)
Executes the function and returns the result. |
|
Generator<R> |
generate(Generator<T> gen)
FactoryMethod that creates a Generator to create the argument to this function. |
|
Functor<R> |
generateNth(int idx,
Generator<?> gen)
Generates the argument at the given index to this functor |
Methods inherited from class net.sf.jga.fn.Functor |
---|
accept |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.jga.fn.Visitable |
---|
accept |
Constructor Detail |
---|
public UnaryFunctor()
Method Detail |
---|
public abstract R fn(T arg)
public <F> UnaryFunctor<F,R> compose(UnaryFunctor<F,T> f)
fnthis(f(x)))
public <F1,F2> BinaryFunctor<F1,F2,R> compose(BinaryFunctor<F1,F2,T> f)
fnthis(f(x,y)))
public Functor<R> compose(Functor<T> f)
fnthis(f(x0,x0,...)))
public Generator<R> generate(Generator<T> gen)
fnthis(fn())
.
public Generator<R> bind(T val)
fnthis(val)
.
public R eval(java.lang.Object... args)
eval
in class Functor<R>
public Functor<R> bind0th(java.lang.Object arg0, java.lang.Object... args)
bind0th
in class Functor<R>
arg0
- args
-
public Functor<R> bindNth(int idx, java.lang.Object arg0, java.lang.Object... args)
bindNth
in class Functor<R>
idx
- arg0
- args
-
public Functor<R> generateNth(int idx, Generator<?> gen)
generateNth
in class Functor<R>
idx
- arg0
- args
-
public Functor<R> composeNth(int idx, UnaryFunctor<?,?> uf)
composeNth
in class Functor<R>
idx
- arg0
- args
-
public Functor<R> composeNth(int idx, BinaryFunctor<?,?,?> bf)
composeNth
in class Functor<R>
idx
- arg0
- args
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |