anl.aida.formula
Class DefaultFormula
java.lang.Object
anl.aida.formula.DefaultFormula
- All Implemented Interfaces:
- Formula
public class DefaultFormula
- extends java.lang.Object
- implements Formula
Formula implementation that produces data suitable for a tile plot. That is,
the data will include every value for each x,y cell in the domain.
- Version:
- $Revision$ $Date$
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
treeInfo
private ASTTreeInfo treeInfo
parser
private FormulaParser parser
transformer
private DataTransformer transformer
commonUnit
private javax.measure.unit.Unit<?> commonUnit
variables
private java.util.List<FormulaVariable> variables
DefaultFormula
public DefaultFormula(FormulaParser parser,
DataTransformer transformer,
javax.measure.unit.Unit<?> commonUnit)
getFormulaAsString
public java.lang.String getFormulaAsString()
- Description copied from interface:
Formula
- Gets the String representation of the formula.
- Specified by:
getFormulaAsString
in interface Formula
- Returns:
- the String representation of the formula.
transformData
private java.util.List<DefaultFormula.VarFramePair> transformData(java.util.List<DefaultFormula.VarFramePair> data)
createFormulaVars
private void createFormulaVars(DataManager manager)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
readData
private java.util.List<DefaultFormula.VarFramePair> readData(java.util.List<AxisRange> ranges)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
validate
public ValidationResult validate(DataManager manager,
java.util.List<AxisRange> ranges)
- Validates the formula. This checks that the units, layers domains and
timestep are coherent and within range.
- Specified by:
validate
in interface Formula
- Parameters:
manager
- the data manager used to validate the formularanges
- the ranges that will filter or constrain the evaluation.
- Returns:
- a ValidationResult containing the results of the validation.
evaluate
public DataFrame evaluate(DataManager manager,
java.util.List<AxisRange> ranges)
throws IllegalFormulaException
- Description copied from interface:
Formula
- Evaluates the formula to produce a DataFrame.
- Specified by:
evaluate
in interface Formula
- Parameters:
manager
- the DataManager used to help evaluate the formularanges
- the ranges that constrain the evaluation
- Throws:
IllegalFormulaException
- if the formula is unable to be executed.
evaluateFormula
private ucar.ma2.Array evaluateFormula(java.util.List<DefaultFormula.VarFramePair> results)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
createVariable
private Variable createVariable()