org.esa.beam.framework.dataop.barithm
Class SingleFlagSymbol

java.lang.Object
  extended by org.esa.beam.framework.dataop.barithm.RasterDataSymbol
      extended by org.esa.beam.framework.dataop.barithm.SingleFlagSymbol
All Implemented Interfaces:
Symbol

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.

Version:
$Revision$ $Date$
Author:
Norman Fomferra (norman.fomferra@brockmann-consult.de)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.esa.beam.framework.dataop.barithm.RasterDataSymbol
RasterDataSymbol.Source
 
Field Summary
 
Fields inherited from class org.esa.beam.framework.dataop.barithm.RasterDataSymbol
data, GEOPHYSICAL, RAW
 
Constructor Summary
SingleFlagSymbol(String symbolName, RasterDataNode raster, int flagMask)
           
 
Method Summary
 boolean evalB(EvalEnv env)
          Evaluates this symbol to a boolean value.
 double evalD(EvalEnv env)
          Evaluates this symbol to a double value.
 int evalI(EvalEnv env)
          Evaluates this symbol to an int value.
 int getFlagMask()
          Returns the flag mask used by this symbol.
 int getRetType()
          Gets the symbol's return type.
 
Methods inherited from class org.esa.beam.framework.dataop.barithm.RasterDataSymbol
evalS, getName, getRaster, getSource, setData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleFlagSymbol

public SingleFlagSymbol(String symbolName,
                        RasterDataNode raster,
                        int flagMask)
Method Detail

getRetType

public final int getRetType()
Description copied from interface: Symbol
Gets the symbol's return type.

Specified by:
getRetType in interface Symbol
Overrides:
getRetType in class RasterDataSymbol
Returns:
the type, should always be one of the TYPE_X constants defined in the Term class.

getFlagMask

public final int getFlagMask()
Returns the flag mask 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 a boolean value.

Specified by:
evalB in interface Symbol
Overrides:
evalB in class RasterDataSymbol
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 an int value.

Specified by:
evalI in interface Symbol
Overrides:
evalI in class RasterDataSymbol
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 a double value.

Specified by:
evalD in interface Symbol
Overrides:
evalD in class RasterDataSymbol
Parameters:
env - the application dependant environment.
Returns:
a double value
Throws:
EvalException - if the evaluation fails


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.