dods.dap.Server
Class Operator

java.lang.Object
  extended by dods.dap.Server.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.

Version:
$Revision: 1.3 $
Author:
ndp

Field Summary
 
Fields inherited from interface dods.dap.parser.ExprParserConstants
AMPERSAND, ASTERISK, COLON, COMMA, DEFAULT, EOF, EQUAL, EXPONENT, FLOAT, GREATER, GREATER_EQL, ID, INT, LBRACE, LBRACKET, LESS, LESS_EQL, LPAREN, MANTISSA, NOT_EQUAL, QUOTED_STR, RBRACE, RBRACKET, REGEXP, RPAREN, SEPARATOR, STR, tokenImage, UNQUOTED_STR, UNTERM_QUOTE
 
Constructor Summary
Operator()
           
 
Method Summary
static boolean op(int oprtr, dods.dap.BaseType lop, dods.dap.BaseType rop)
          Performs the Relatove Operation (RelOp) indicated by the parameter oprtr on the 2 passed BaseTypes if appropriate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Operator

public Operator()
Method Detail

op

public static boolean op(int oprtr,
                         dods.dap.BaseType lop,
                         dods.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 dods.dap.parser.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:
ExprParserConstants