net.sf.jga.fn.adaptor
Class GenerateBinary<T1,T2,R>

java.lang.Object
  extended by net.sf.jga.fn.BinaryFunctor<T1,T2,R>
      extended by net.sf.jga.fn.adaptor.GenerateBinary<T1,T2,R>
All Implemented Interfaces:
java.io.Serializable, Visitable

public class GenerateBinary<T1,T2,R>
extends BinaryFunctor<T1,T2,R>

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

Copyright © 2004 David A. Hall

Author:
David A. Hall
See Also:
Serialized Form

Nested Class Summary
static interface GenerateBinary.Visitor
          Interface for classes that may interpret a GenerateBinary functor.
 
Constructor Summary
GenerateBinary(Generator<R> gen)
           
 
Method Summary
 void accept(Visitor v)
          Calls the Visitor's visit(GenerateBinary) method, if it implements the nested Visitor interface.
 R fn(T1 arg1, T2 arg2)
          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.BinaryFunctor
bind, bind1st, bind2nd, compose, compose, distribute, generate, generate1st, generate2nd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenerateBinary

public GenerateBinary(Generator<R> gen)
Method Detail

getGenerator

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


fn

public R fn(T1 arg1,
            T2 arg2)
Returns the results of invoking the generator. The arguments are ignored.

Specified by:
fn in class BinaryFunctor<T1,T2,R>

accept

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

Specified by:
accept in interface Visitable
Overrides:
accept in class BinaryFunctor<T1,T2,R>

toString

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


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