Package opendap.servers
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.
-
-
Field Summary
-
Fields inherited from interface opendap.servers.parsers.ExprParserConstants
AMPERSAND, COLON, COMMA, DEFAULT, EOF, EQUAL, FLOATCONST, FUNCTION, GREATER, GREATER_EQL, INTCONST, LBRACE, LBRACKET, LESS, LESS_EQL, LPAREN, NOT_EQUAL, operatorImage, RBRACE, RBRACKET, REGEXP, RPAREN, SEPARATOR, STRINGCONST, tokenImage, VAR, WORD
-
-
Constructor Summary
Constructors Constructor Description Operator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanop(int oprtr, opendap.dap.BaseType lop, opendap.dap.BaseType rop)Performs the Relatove Operation (RelOp) indicated by the parameteroprtron the 2 passed BaseTypes if appropriate.
-
-
-
Method Detail
-
op
public static boolean op(int oprtr, opendap.dap.BaseType lop, opendap.dap.BaseType rop) throws InvalidOperatorException, RegExpException, SBHExceptionPerforms the Relatove Operation (RelOp) indicated by the parameteroprtron 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 andInvalidOperatorExceptionis thrown.- Parameters:
oprtr- The operatoration to perform as defined inopendap.servers.parsers.ExprParserConstantslop- 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:
InvalidOperatorExceptionRegExpExceptionSBHException- See Also:
ExprParserConstants
-
-