net.sf.jga.parser
Class UnaryFunctorRef<T,R>

java.lang.Object
  extended by net.sf.jga.parser.UnaryFunctorRef<T,R>
All Implemented Interfaces:
FunctorRef<R,UnaryFunctor<T,R>>

public class UnaryFunctorRef<T,R>
extends java.lang.Object
implements FunctorRef<R,UnaryFunctor<T,R>>

Contains and describes a UnaryFunctor being built by the functor parser.

Copyright © 2004-2005 David A. Hall

Author:
David A. Hall

Constructor Summary
UnaryFunctorRef(UnaryFunctor<T,R> uf, java.lang.Class<T> argType, java.lang.String name, java.lang.Class<R> returnType)
           
 
Method Summary
 java.lang.String getArgName(int i)
          returns the name of the i'th argument to the current functor, as described in the expression being parsed.
 java.lang.Class<?> getArgType(int i)
          returns the type of the i'th argument to the current functor.
 UnaryFunctor<T,R> getFunctor()
          Returns the functor to which this refers.
 int getNumberArgs()
          returns the number of arguments that the current functor requires.
 java.lang.Class<R> getReturnType()
          returns the type of objects that the current functor returns.
 boolean isConstant()
          Returns TRUE if the underlying functor is a constant generator
 boolean isIdentity()
          Returns TRUE if the underlying functor is a unary identity
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnaryFunctorRef

public UnaryFunctorRef(UnaryFunctor<T,R> uf,
                       java.lang.Class<T> argType,
                       java.lang.String name,
                       java.lang.Class<R> returnType)
Method Detail

getFunctor

public UnaryFunctor<T,R> getFunctor()
Description copied from interface: FunctorRef
Returns the functor to which this refers.

Specified by:
getFunctor in interface FunctorRef<R,UnaryFunctor<T,R>>

getReturnType

public java.lang.Class<R> getReturnType()
Description copied from interface: FunctorRef
returns the type of objects that the current functor returns.

Specified by:
getReturnType in interface FunctorRef<R,UnaryFunctor<T,R>>

getNumberArgs

public int getNumberArgs()
Description copied from interface: FunctorRef
returns the number of arguments that the current functor requires. Currently, the implementations tend to be hard coded.

Specified by:
getNumberArgs in interface FunctorRef<R,UnaryFunctor<T,R>>

getArgType

public java.lang.Class<?> getArgType(int i)
Description copied from interface: FunctorRef
returns the type of the i'th argument to the current functor.

Specified by:
getArgType in interface FunctorRef<R,UnaryFunctor<T,R>>

getArgName

public java.lang.String getArgName(int i)
Description copied from interface: FunctorRef
returns the name of the i'th argument to the current functor, as described in the expression being parsed.

Specified by:
getArgName in interface FunctorRef<R,UnaryFunctor<T,R>>

isConstant

public boolean isConstant()
Description copied from interface: FunctorRef
Returns TRUE if the underlying functor is a constant generator

Specified by:
isConstant in interface FunctorRef<R,UnaryFunctor<T,R>>

isIdentity

public boolean isIdentity()
Description copied from interface: FunctorRef
Returns TRUE if the underlying functor is a unary identity

Specified by:
isIdentity in interface FunctorRef<R,UnaryFunctor<T,R>>

toString

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


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