|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Function
A representation of a function. A function has a name, a return type and can be evaluated by passing a number of arguments to it.
Within an expression, a reference to a function is created if the parser
encounters a name followed by an argument list and the name can be resolved
through the parser's current namespace.
The resulting term in this case is an instance of .
Term.Call
| Method Summary | |
|---|---|
boolean |
evalB(EvalEnv env,
Term[] args)
Evaluates this function to a double value. |
double |
evalD(EvalEnv env,
Term[] args)
Evaluates this function to a double value. |
int |
evalI(EvalEnv env,
Term[] args)
Evaluates this function to an int value. |
int |
getArgType(int argIndex)
Gets the type of a function's i-th argument. |
String |
getName()
Gets the function's name. |
int |
getNumArgs()
Gets the function's number of arguments. |
int |
getRetType()
Gets the function's return type. |
| Method Detail |
|---|
String getName()
null.int getRetType()
TYPE_X constants
defined in the Term class.int getNumArgs()
int getArgType(int argIndex)
argIndex - The argument index.
TYPE_X constants defined in the Term class.
boolean evalB(EvalEnv env,
Term[] args)
throws EvalException
double value.
env - the application dependant environment.args - the (un-evaluated) arguments passed to the function
double value
EvalException - if the evaluation fails
int evalI(EvalEnv env,
Term[] args)
throws EvalException
int value.
env - the application dependant environment.args - the (un-evaluated) arguments passed to the function
int value
EvalException - if the evaluation fails
double evalD(EvalEnv env,
Term[] args)
throws EvalException
double value.
env - the application dependant environment.args - the (un-evaluated) arguments passed to the function
double value
EvalException - if the evaluation fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||