Package opendap.servers
Class RelOpClause
java.lang.Object
opendap.servers.AbstractClause
opendap.servers.RelOpClause
- All Implemented Interfaces:
Clause,TopLevelClause
Represents a clause which compares subclauses, using one of the
relative operators supported by the Operator class.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SubClauseprotected intprotected Listprotected booleanFields inherited from class opendap.servers.AbstractClause
children, constant, defined -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRelOpClause(int operator, SubClause lhs, List rhs) Creates a new RelOpClause. -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate()Evaluates the clause, first calling evaluate() on any sub-clauses it contains.getLHS()Returns a SubClause representing the right-hand side of the comparison.intReturns the type of comparisongetRHS()Returns a list of SubClauses representing the right-hand side of the comparison.booleangetValue()Returns the current value of the clause.voidPrints the original string representation of this clause.Methods inherited from class opendap.servers.AbstractClause
getChildren, isConstant, isDefinedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface opendap.servers.Clause
getChildren, isConstant, isDefined
-
Field Details
-
value
protected boolean value -
operator
protected int operator -
lhs
-
rhs
-
-
Constructor Details
-
RelOpClause
Creates a new RelOpClause. If the lhs and all the elements of the rhs are constant, the RelOpClause will be flagged as constant, and evaluated immediately.- Parameters:
operator- The operator invoked by the clauselhs- The left-hand side of the comparison.rhs- A list of SubClauses representing the right-hand side of the comparison.- Throws:
DAP2ServerSideException- Thrown if the clause is constant, but the attempt to evaluate it fails.
-
-
Method Details
-
getValue
public boolean getValue()Description copied from interface:TopLevelClauseReturns the current value of the clause. The value of non-constant Clauses is undefined until the evaluate() method has been called.- Specified by:
getValuein interfaceTopLevelClause
-
evaluate
Description copied from interface:TopLevelClauseEvaluates the clause, first calling evaluate() on any sub-clauses it contains. Implementations of this method should flag the clause as "defined" if the evaluation is successful.- Specified by:
evaluatein interfaceTopLevelClause- Throws:
DAP2ServerSideException- Thrown if the evaluation fails for any reason.
-
getLHS
Returns a SubClause representing the right-hand side of the comparison. -
getRHS
Returns a list of SubClauses representing the right-hand side of the comparison. -
getOperator
public int getOperator()Returns the type of comparison- See Also:
-
printConstraint
Prints the original string representation of this clause. For use in debugging.- Specified by:
printConstraintin interfaceClause
-