Package noaa.coastwatch.util.expression
Class ExpressionTest
java.lang.Object
noaa.coastwatch.util.expression.ExpressionTest
- All Implemented Interfaces:
Runnable
The
ExpressionTest
class test a parser with a given set of
inputs and expected result.- Since:
- 3.4.0
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionExpressionTest
(String expression, ExpressionParser parser, String[] names, double[] values, double result) Creates a new expression test. -
Method Summary
-
Constructor Details
-
ExpressionTest
public ExpressionTest(String expression, ExpressionParser parser, String[] names, double[] values, double result) Creates a new expression test.- Parameters:
expression
- the expression to parse.parser
- the parser implementation to use for the expression.names
- the names of the variables available to the expression.values
- the values of the variables.result
- the expected result.
-
-
Method Details
-
toString
-
run
public void run() -
isCorrect
public boolean isCorrect()Gets the result is correct flag.- Returns:
- true if the result was correct after running the test or false if not.
-
not
Gets the opposite of this test.- Returns:
- a test that will return true if this test returns false and vice-versa.
-