Package org.esa.snap.core.jexp
Interface Function
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
- Version:
- $Revision$ $Date$
-
Method Summary
Modifier and TypeMethodDescriptionbooleanEvaluates this function to abooleanvalue.doubleEvaluates this function to adoublevalue.intEvaluates this function to anintvalue.intgetArgType(int argIndex) Gets the type of a function's i-th argument.getName()Gets the function's name.intGets the function's number of arguments.intGets the function's return type.boolean
-
Method Details
-
getName
String getName()Gets the function's name.- Returns:
- the name, should never be
null.
-
getRetType
int getRetType()Gets the function's return type.- Returns:
- the type, should always be one of the
TYPE_X constants defined in theTermclass.
-
getNumArgs
int getNumArgs()Gets the function's number of arguments.- Returns:
- number of arguments.
-
getArgType
int getArgType(int argIndex) Gets the type of a function's i-th argument.- Parameters:
argIndex- The argument index.- Returns:
- an arry of types, each element should always be one of
the
TYPE_X constants defined in theTermclass.
-
evalB
Evaluates this function to abooleanvalue.- Parameters:
env- the application dependant environment.args- the (un-evaluated) arguments passed to the function- Returns:
- a
booleanvalue - Throws:
EvalException- if the evaluation fails
-
evalI
Evaluates this function to anintvalue.- Parameters:
env- the application dependant environment.args- the (un-evaluated) arguments passed to the function- Returns:
- an
intvalue - Throws:
EvalException- if the evaluation fails
-
evalD
Evaluates this function to adoublevalue.- Parameters:
env- the application dependant environment.args- the (un-evaluated) arguments passed to the function- Returns:
- a
doublevalue - Throws:
EvalException- if the evaluation fails
-
isConst
- Returns:
true, if this symbol has a constant value with respect to the given arguments and to anyEvalEnv, includingnull.
-