Package org.esa.snap.core.jexp
Interface Symbol
- All Known Subinterfaces:
Variable
- All Known Implementing Classes:
RasterDataSymbol
,SingleFlagSymbol
public interface Symbol
Represents a read-only symbol. A symbol can be a named constant or variable.
It has a return type an can be evaluated.
Within an expression, a reference to a symbol is created if the parser
encounters a name and this name can be resolved through the parser's current namespace.
The resulting term in this case is an instance of
.Term.Ref
- Version:
- $Revision$ $Date$
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Evaluates this symbol to aboolean
value.double
Evaluates this symbol to adouble
value.int
Evaluates this symbol to anint
value.Evaluates this symbol to aString
value.getName()
Gets the symbol's name.int
Gets the symbol's return type.boolean
isConst()
-
Method Details
-
getName
String getName()Gets the symbol's name.- Returns:
- the name, should never be
null
-
getRetType
int getRetType()Gets the symbol's return type.- Returns:
- the type, should always be one of the
TYPE_
X constants defined in theTerm
class.
-
evalB
Evaluates this symbol to aboolean
value.- Parameters:
env
- the application dependant environment.- Returns:
- a
boolean
value - Throws:
EvalException
- if the evaluation fails
-
evalI
Evaluates this symbol to anint
value.- Parameters:
env
- the application dependant environment.- Returns:
- an
int
value - Throws:
EvalException
- if the evaluation fails
-
evalD
Evaluates this symbol to adouble
value.- Parameters:
env
- the application dependant environment.- Returns:
- a
double
value - Throws:
EvalException
- if the evaluation fails
-
evalS
Evaluates this symbol to aString
value.- Parameters:
env
- the application dependant environment.- Returns:
- a
double
value - Throws:
EvalException
- if the evaluation fails
-
isConst
boolean isConst()- Returns:
true
, if this symbol has a constant value with respect to anyEvalEnv
, evennull
.
-