Package org.esa.snap.core.dataop.barithm
Class SingleFlagSymbol
- java.lang.Object
-
- org.esa.snap.core.dataop.barithm.RasterDataSymbol
-
- org.esa.snap.core.dataop.barithm.SingleFlagSymbol
-
public final class SingleFlagSymbol extends RasterDataSymbol
Represents a read-only symbol. A symbol can be a named constant or variable. It has a return type an can be evaluated. This class represents a specific implementation for flag expressions.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.esa.snap.core.dataop.barithm.RasterDataSymbol
RasterDataSymbol.Source
-
-
Field Summary
-
Fields inherited from class org.esa.snap.core.dataop.barithm.RasterDataSymbol
data, GEOPHYSICAL, RAW
-
-
Constructor Summary
Constructors Constructor Description SingleFlagSymbol(String symbolName, RasterDataNode raster, int flagMask)
SingleFlagSymbol(String symbolName, RasterDataNode raster, int flagMask, int flagValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleFlagSymbol
clone()
boolean
evalB(EvalEnv env)
Evaluates this symbol to aboolean
value.double
evalD(EvalEnv env)
Evaluates this symbol to adouble
value.int
evalI(EvalEnv env)
Evaluates this symbol to anint
value.int
getFlagMask()
Returns the flag mask used by this symbol.int
getFlagValue()
Returns the flag value used by this symbol.int
getRetType()
Gets the symbol's return type.
-
-
-
Constructor Detail
-
SingleFlagSymbol
public SingleFlagSymbol(String symbolName, RasterDataNode raster, int flagMask)
-
SingleFlagSymbol
public SingleFlagSymbol(String symbolName, RasterDataNode raster, int flagMask, int flagValue)
-
-
Method Detail
-
getRetType
public final int getRetType()
Description copied from interface:Symbol
Gets the symbol's return type.- Specified by:
getRetType
in interfaceSymbol
- Overrides:
getRetType
in classRasterDataSymbol
- Returns:
- the type, should always be one of the
TYPE_
X constants defined in theTerm
class.
-
getFlagMask
public final int getFlagMask()
Returns the flag mask used by this symbol.- Returns:
- the flag mask.
-
getFlagValue
public final int getFlagValue()
Returns the flag value used by this symbol.- Returns:
- the flag mask.
-
evalB
public final boolean evalB(EvalEnv env) throws EvalException
Description copied from interface:Symbol
Evaluates this symbol to aboolean
value.- Specified by:
evalB
in interfaceSymbol
- Overrides:
evalB
in classRasterDataSymbol
- Parameters:
env
- the application dependant environment.- Returns:
- a
boolean
value - Throws:
EvalException
- if the evaluation fails
-
evalI
public final int evalI(EvalEnv env) throws EvalException
Description copied from interface:Symbol
Evaluates this symbol to anint
value.- Specified by:
evalI
in interfaceSymbol
- Overrides:
evalI
in classRasterDataSymbol
- Parameters:
env
- the application dependant environment.- Returns:
- an
int
value - Throws:
EvalException
- if the evaluation fails
-
evalD
public final double evalD(EvalEnv env) throws EvalException
Description copied from interface:Symbol
Evaluates this symbol to adouble
value.- Specified by:
evalD
in interfaceSymbol
- Overrides:
evalD
in classRasterDataSymbol
- Parameters:
env
- the application dependant environment.- Returns:
- a
double
value - Throws:
EvalException
- if the evaluation fails
-
clone
public SingleFlagSymbol clone()
- Overrides:
clone
in classRasterDataSymbol
-
-