net.sf.jga.fn.adaptor
Class GenerateUnary<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.GenerateUnary<T,R>
All Implemented Interfaces:
java.io.Serializable, Visitable

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

UnaryFunctor that returns the result of a nested Generator. The argument to the UnaryFunctor is ignored.

Copyright © 2004-2005 David A. Hall

Author:
David A. Hall
See Also:
Serialized Form

Nested Class Summary
static interface GenerateUnary.Visitor
          Interface for classes that may interpret a GenerateUnary functor.
 
Constructor Summary
GenerateUnary(Generator<R> gen)
           
 
Method Summary
 void accept(Visitor v)
          Calls the Visitor's visit(GenerateUnary) method, if it implements the nested Visitor interface.
 R fn(T arg)
          Returns the results of invoking the generator.
 Generator<R> getGenerator()
          Returns the generator whose results are returned.
 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

GenerateUnary

public GenerateUnary(Generator<R> gen)
Method Detail

getGenerator

public Generator<R> getGenerator()
Returns the generator whose results are returned.


fn

public R fn(T arg)
Returns the results of invoking the generator. The argument is ignored.

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

accept

public void accept(Visitor v)
Calls the Visitor's visit(GenerateUnary) 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.