Class ExpressionTest

java.lang.Object
noaa.coastwatch.util.expression.ExpressionTest
All Implemented Interfaces:
Runnable

public class ExpressionTest extends Object implements Runnable
The ExpressionTest class test a parser with a given set of inputs and expected result.
Since:
3.4.0
Author:
Peter Hollemans
  • 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

      public String toString()
      Overrides:
      toString in class Object
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • 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

      public ExpressionTest not()
      Gets the opposite of this test.
      Returns:
      a test that will return true if this test returns false and vice-versa.