Package thredds.server.opendap.servers
Class RelOpClause
- java.lang.Object
-
- thredds.server.opendap.servers.AbstractClause
-
- thredds.server.opendap.servers.RelOpClause
-
- All Implemented Interfaces:
Clause,TopLevelClause
public class RelOpClause extends AbstractClause implements TopLevelClause
Represents a clause which compares subclauses, using one of the relative operators supported by the Operator class.- See Also:
Operator,ClauseFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRelOpClause(int operator, SubClause lhs, List rhs)Creates a new RelOpClause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanevaluate()Evaluates the clause, first calling evaluate() on any sub-clauses it contains.SubClausegetLHS()Returns a SubClause representing the right-hand side of the comparison.intgetOperator()Returns the type of comparisonListgetRHS()Returns a list of SubClauses representing the right-hand side of the comparison.booleangetValue()Returns the current value of the clause.voidprintConstraint(PrintWriter os)Prints the original string representation of this clause.-
Methods inherited from class thredds.server.opendap.servers.AbstractClause
getChildren, isConstant, isDefined
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface thredds.server.opendap.servers.Clause
getChildren, isConstant, isDefined
-
-
-
-
Constructor Detail
-
RelOpClause
protected RelOpClause(int operator, SubClause lhs, List rhs) throws DAP2ServerSideExceptionCreates 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 Detail
-
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
public boolean evaluate() throws DAP2ServerSideExceptionDescription 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
public SubClause getLHS()
Returns a SubClause representing the right-hand side of the comparison.
-
getRHS
public List 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:
ExprParserConstants
-
printConstraint
public void printConstraint(PrintWriter os)
Prints the original string representation of this clause. For use in debugging.- Specified by:
printConstraintin interfaceClause
-
-