|
|||||||||
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> net.sf.jga.fn.adaptor.ChainUnary<T,F,R>
public class ChainUnary<T,F,R>
Unary Functor that passes the results of one Unary Functor as the argument to another Unary 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
Nested Class Summary | |
---|---|
static interface |
ChainUnary.Visitor
Interface for classes that may interpret a ChainUnary functor. |
Constructor Summary | |
---|---|
ChainUnary(UnaryFunctor<F,R> f,
UnaryFunctor<T,F> g)
Builds a BinaryCompose functor, given the outer functor f the inner functor g. |
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(BinaryCompose) method, if it
implements the nested Visitor interface. |
R |
fn(T x)
Given argument x, passes x to the inner functor, and passes the result to the outer functor. |
UnaryFunctor<T,F> |
getInnerFunctor()
Returns the inner functor |
UnaryFunctor<F,R> |
getOuterFunctor()
Returns the outer 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 ChainUnary(UnaryFunctor<F,R> f, UnaryFunctor<T,F> g)
java.lang.IllegalArgumentException
- if any of the functors is missingMethod Detail |
---|
public UnaryFunctor<F,R> getOuterFunctor()
public UnaryFunctor<T,F> getInnerFunctor()
public R fn(T x)
fn
in class UnaryFunctor<T,R>
public java.lang.String toString()
toString
in class java.lang.Object
public void accept(Visitor v)
visit(BinaryCompose)
method, if it
implements the nested Visitor interface.
accept
in interface Visitable
accept
in class Functor<R>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |