Class Operator

java.lang.Object
opendap.servers.Operator
All Implemented Interfaces:
ExprParserConstants

public class Operator extends Object implements ExprParserConstants
This class contains the code for performing relative operations (RelOps) on BaseTypes. It contains one heavily overloaded method that is smart enough to figure out which actual BaseType were passed in and perform (if appropriate) the RelOp comparison on the 2 types.
  • Constructor Details

    • Operator

      public Operator()
  • Method Details

    • op

      public static boolean op(int oprtr, opendap.dap.BaseType lop, opendap.dap.BaseType rop) throws InvalidOperatorException, RegExpException, SBHException
      Performs the Relatove Operation (RelOp) indicated by the parameter oprtr on the 2 passed BaseTypes if appropriate.

      Obviously some type don't compare logically, such as asking if String is less than a Float. For these non sensical operations and InvalidOperatorException is thrown.

      Parameters:
      oprtr - The operatoration to perform as defined in opendap.servers.parsers.ExprParserConstants
      lop - A BaseType to be used as the left operand.
      rop - A BaseType to be used as the right operand.
      Returns:
      True is the operation evaluates as true, flase otherwise.
      Throws:
      InvalidOperatorException
      RegExpException
      SBHException
      See Also: