Package opendap.servers
Class BoolFunctionClause
java.lang.Object
opendap.servers.AbstractClause
opendap.servers.BoolFunctionClause
- All Implemented Interfaces:
Clause,TopLevelClause
Represents a clause which invokes a function that returns a boolean value.
- See Also:
-
Field Summary
FieldsFields inherited from class opendap.servers.AbstractClause
children, constant, defined -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBoolFunctionClause(BoolFunction function, List children) Creates a new BoolFunctionClause. -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate()Evaluates the clause, first calling evaluate() on any sub-clauses it contains.Returns the server-side function invoked by this clausebooleangetValue()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
-
function
-
value
protected boolean value
-
-
Constructor Details
-
BoolFunctionClause
Creates a new BoolFunctionClause.- Parameters:
function- The function invoked by the clausechildren- A list of SubClauses, to be given as arguments to the function. If all the arguments are constant, the function clause will be flagged as constant, and evaluated immediatelyx.- Throws:
DAP2ServerSideException- Thrown if either 1) the function does not accept the arguments given, or 2) the clause is constant, and 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.
-
getFunction
Returns the server-side function invoked by this clause -
printConstraint
Prints the original string representation of this clause. For use in debugging.- Specified by:
printConstraintin interfaceClause
-