com.bc.jexp
Interface Symbol

All Known Subinterfaces:
Variable
All Known Implementing Classes:
AbstractSymbol, AbstractSymbol.B, AbstractSymbol.D, AbstractSymbol.I, 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$
Author:
Norman Fomferra (norman.fomferra@brockmann-consult.de)

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.
 String evalS(EvalEnv env)
          Evaluates this symbol to a String value.
 String getName()
          Gets the symbol's name.
 int getRetType()
          Gets the symbol's return type.
 

Method Detail

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 the Term class.

evalB

boolean evalB(EvalEnv env)
              throws EvalException
Evaluates this symbol to a boolean value.

Parameters:
env - the application dependant environment.
Returns:
a boolean value
Throws:
EvalException - if the evaluation fails

evalI

int evalI(EvalEnv env)
          throws EvalException
Evaluates this symbol to an int value.

Parameters:
env - the application dependant environment.
Returns:
an int value
Throws:
EvalException - if the evaluation fails

evalD

double evalD(EvalEnv env)
             throws EvalException
Evaluates this symbol to a double value.

Parameters:
env - the application dependant environment.
Returns:
a double value
Throws:
EvalException - if the evaluation fails

evalS

String evalS(EvalEnv env)
             throws EvalException
Evaluates this symbol to a String value.

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.