| net.sf.jga.parser.FunctorRef
FunctorRef | public interface FunctorRef (Code) | | 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 |
Field Summary | |
final public static int | BINARY_FN value returned by getReferenceType() when it refers to a binary functor. | final public static int | CONSTANT value returned by getReferenceType() for constants. | final public static int | GENERATOR value returned by getReferenceType() when it refers to a generator. | final public static int | IDENTITY value returned by getReferenceType() when it refers to an Identity.
An Identity is by definition a UnaryFunctor, and in many cases, binding an
Identity is unnecessary. | final public static int | UNARY_FN value returned by getReferenceType() when it refers to a unary functor. |
Method Summary | |
public String | getArgName(int i) returns the name of the i'th argument to the current functor, as described
in the expression being parsed. | public Class | getArgType(int i) returns the type of the i'th argument to the current functor. | public T | getFunctor() Returns the functor to which this refers. | public int | getNumberArgs() returns the number of arguments that the current functor requires. | public int | getReferenceType() returns a value that classifies the functor by the number of arguments that
it requires. | public Class | getReturnType() returns the type of objects that the current functor returns. |
BINARY_FN | final public static int BINARY_FN(Code) | | value returned by getReferenceType() when it refers to a binary functor.
|
CONSTANT | final public static int CONSTANT(Code) | | value returned by getReferenceType() for constants. A constant is
by definition a Generator, and many constant expressions can be evaluated at
parse time.
|
GENERATOR | final public static int GENERATOR(Code) | | value returned by getReferenceType() when it refers to a generator.
|
IDENTITY | final public static int IDENTITY(Code) | | value returned by getReferenceType() when it refers to an Identity.
An Identity is by definition a UnaryFunctor, and in many cases, binding an
Identity is unnecessary. Singling out this special case reduces the complexity
of many functors that are produced.
|
UNARY_FN | final public static int UNARY_FN(Code) | | value returned by getReferenceType() when it refers to a unary functor.
|
getArgName | public String getArgName(int i)(Code) | | returns the name of the i'th argument to the current functor, as described
in the expression being parsed.
throws: IllegalArgumentException - if the current functor takes fewer than iarguments (or if i is < 0) |
getArgType | public Class getArgType(int i)(Code) | | returns the type of the i'th argument to the current functor.
throws: IllegalArgumentException - if the current functor takes fewer than iarguments (or if i is < 0) |
getFunctor | public T getFunctor()(Code) | | Returns the functor to which this refers.
|
getNumberArgs | public int getNumberArgs()(Code) | | returns the number of arguments that the current functor requires. Currently,
the implementations tend to be hard coded.
|
getReferenceType | public int getReferenceType()(Code) | | returns a value that classifies the functor by the number of arguments that
it requires.
|
getReturnType | public Class getReturnType()(Code) | | returns the type of objects that the current functor returns.
|
|
|