net.sf.jga.parser
Interface FunctorRef<R,F extends Functor<R>>

All Known Implementing Classes:
BinaryFunctorRef, GeneratorRef, UnaryFunctorRef, VariableFunctorRef

public interface FunctorRef<R,F extends Functor<R>>

Contains and describes a functor being built by the functor parser. Many of the parsing methods return and/or accept instances of this interface that describe a functor, describe its broad type, the number, names, and types of its arguments, and the type returned.

Copyright © 2004-2005 David A. Hall

Author:
David A. Hall

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.
 F 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
 

Method Detail

getFunctor

F getFunctor()
Returns the functor to which this refers.


getReturnType

java.lang.Class<R> getReturnType()
returns the type of objects that the current functor returns.


getNumberArgs

int getNumberArgs()
returns the number of arguments that the current functor requires. Currently, the implementations tend to be hard coded.


getArgType

java.lang.Class<?> getArgType(int i)
returns the type of the i'th argument to the current functor.

Throws:
java.lang.IllegalArgumentException - if the current functor takes fewer than i arguments (or if i is < 0)

getArgName

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.

Throws:
java.lang.IllegalArgumentException - if the current functor takes fewer than i arguments (or if i is < 0)

isConstant

boolean isConstant()
Returns TRUE if the underlying functor is a constant generator


isIdentity

boolean isIdentity()
Returns TRUE if the underlying functor is a unary identity



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