net.sf.jga.fn.adaptor
Class CompoundUnary<T,R>

java.lang.Object
  extended by net.sf.jga.fn.Functor<R>
      extended by net.sf.jga.fn.UnaryFunctor<T,R>
          extended by net.sf.jga.fn.adaptor.CompoundUnary<T,R>
All Implemented Interfaces:
java.io.Serializable, Visitable

public class CompoundUnary<T,R>
extends UnaryFunctor<T,R>

Executes two UnaryFunctors, returning the results of the second.

Copyright © 2005 David A. Hall

See Also:
Serialized Form

Nested Class Summary
static interface CompoundUnary.Visitor
          Interface for classes that may interpret a Constant unaryFunctor.
 
Constructor Summary
CompoundUnary(UnaryFunctor<T,?> fn1, UnaryFunctor<T,R> fn2)
           
 
Method Summary
 void accept(Visitor v)
          Calls the Visitor's visit(Constant) method, if it implements the nested Visitor interface.
 R fn(T arg)
          Executes both functors, returning the results of the second.
 UnaryFunctor<T,?> getFirstFunctor()
           
 UnaryFunctor<T,R> getSecondFunctor()
           
 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

CompoundUnary

public CompoundUnary(UnaryFunctor<T,?> fn1,
                     UnaryFunctor<T,R> fn2)
Method Detail

getFirstFunctor

public UnaryFunctor<T,?> getFirstFunctor()
Returns:
the first of the two nested functors

getSecondFunctor

public UnaryFunctor<T,R> getSecondFunctor()
Returns:
the second of the two nested functors

fn

public R fn(T arg)
Executes both functors, returning the results of the second.

Specified by:
fn in class UnaryFunctor<T,R>

accept

public void accept(Visitor v)
Calls the Visitor's visit(Constant) method, if it implements the nested Visitor interface.

Specified by:
accept in interface Visitable
Overrides:
accept in class Functor<R>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2002-2006 David A. Hall. All Rights Reserved.