anl.aida.formula
Interface FormulaParser

All Known Implementing Classes:
DefaultParser

public interface FormulaParser

Interface for classes that implement formula parsing and evaluation.

Version:
$Revision$ $Date$

Method Summary
 FormulaArray evaluate()
          Evaluates the formula and returns the result as a FormulaArray.
 java.lang.String getFormulaAsString()
          Gets the String representation of the formula.
 ASTTreeInfo parse()
          Parses the formula and returns information about the parse tree.
 void setCoodinateIndices(int timeStep, int layer, int x, int y)
          Sets the coordinate indices under which the next evaluation will take place.
 void setVariable(java.lang.String name, DataFrame value)
          Sets the value of the variable to the specified array.
 

Method Detail

parse

ASTTreeInfo parse()
                  throws IllegalFormulaException
Parses the formula and returns information about the parse tree.

Returns:
returns information about the parse tree.
Throws:
IllegalFormulaException - if there is an error during parsing.

getFormulaAsString

java.lang.String getFormulaAsString()
Gets the String representation of the formula.

Returns:
the String representation of the formula.

setCoodinateIndices

void setCoodinateIndices(int timeStep,
                         int layer,
                         int x,
                         int y)
Sets the coordinate indices under which the next evaluation will take place.

Parameters:
timeStep - the time step index
layer - the layer index
x - the x index
y - the y index

setVariable

void setVariable(java.lang.String name,
                 DataFrame value)
Sets the value of the variable to the specified array.

Parameters:
name - the name of the variable
value - the array value

evaluate

FormulaArray evaluate()
                      throws IllegalFormulaException
Evaluates the formula and returns the result as a FormulaArray.

Returns:
the result of the evaluation
Throws:
IllegalFormulaException - if the formula is invalid