Class SingleFlagSymbol

  • All Implemented Interfaces:
    Cloneable, 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.

    • 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 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.
      • 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 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