anl.aida.formula
Class FormulaValidator
java.lang.Object
anl.aida.formula.FormulaValidator
public class FormulaValidator
- extends java.lang.Object
Validates a formula for unit, layer, domain and timestep coherence.
- Version:
- $Revision$ $Date$
Method Summary |
private void |
checkAxes(java.util.List<AxisRange> ranges)
|
private ValidationResult |
checkTime(java.util.List<AxisRange> ranges)
|
private void |
checkTimeRange(java.util.List<AxisRange> ranges,
java.util.Date startDate,
java.util.Date endDate)
|
private ValidationResult |
checkUnits(javax.measure.unit.Unit commonUnit)
|
private IllegalFormulaException |
createValidationEx(FormulaVariable var1,
FormulaVariable var2,
java.lang.String axis)
|
private IllegalFormulaException |
createValidationRangeEx(FormulaVariable var1,
Range range,
java.lang.String axis)
|
private AxisRange |
findAxisByType(AxisType type,
java.util.List<AxisRange> axes)
|
private void |
testLayer(CoordAxis layerAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
|
private void |
testOther(CoordAxis otherAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
|
private void |
testRange(java.util.List<AxisRange> ranges,
CoordAxis axis,
AxisType type,
java.lang.String axisName,
FormulaVariable var)
|
private void |
testX(CoordAxis xAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
|
private void |
testY(CoordAxis yAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
|
ValidationResult |
validate(javax.measure.unit.Unit<?> commonUnit,
java.util.List<AxisRange> ranges)
Validates the formula. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
variables
private java.util.List<FormulaVariable> variables
UNITS_WARN
public static final java.lang.String UNITS_WARN
- See Also:
- Constant Field Values
FormulaValidator
public FormulaValidator(java.util.List<FormulaVariable> variables)
validate
public ValidationResult validate(javax.measure.unit.Unit<?> commonUnit,
java.util.List<AxisRange> ranges)
- Validates the formula. This checks that the units, layers domains and
timestep are coherent and within range.
- Parameters:
commonUnit
- validate the units against this common unit.ranges
- the ranges that will filter or constrain the evaluation.
- Returns:
- a ValidationResult containing the results of the validation.
checkTime
private ValidationResult checkTime(java.util.List<AxisRange> ranges)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
checkTimeRange
private void checkTimeRange(java.util.List<AxisRange> ranges,
java.util.Date startDate,
java.util.Date endDate)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
checkUnits
private ValidationResult checkUnits(javax.measure.unit.Unit commonUnit)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
testOther
private void testOther(CoordAxis otherAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
testLayer
private void testLayer(CoordAxis layerAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
testX
private void testX(CoordAxis xAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
testY
private void testY(CoordAxis yAxis,
FormulaVariable formulaVariable,
FormulaVariable var)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
testRange
private void testRange(java.util.List<AxisRange> ranges,
CoordAxis axis,
AxisType type,
java.lang.String axisName,
FormulaVariable var)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
checkAxes
private void checkAxes(java.util.List<AxisRange> ranges)
throws IllegalFormulaException
- Throws:
IllegalFormulaException
createValidationEx
private IllegalFormulaException createValidationEx(FormulaVariable var1,
FormulaVariable var2,
java.lang.String axis)
createValidationRangeEx
private IllegalFormulaException createValidationRangeEx(FormulaVariable var1,
Range range,
java.lang.String axis)
findAxisByType
private AxisRange findAxisByType(AxisType type,
java.util.List<AxisRange> axes)