Package thredds.server.opendap.servers
Class BoolFunctionClause
- java.lang.Object
-
- thredds.server.opendap.servers.AbstractClause
-
- thredds.server.opendap.servers.BoolFunctionClause
-
- All Implemented Interfaces:
Clause,TopLevelClause
public class BoolFunctionClause extends AbstractClause implements TopLevelClause
Represents a clause which invokes a function that returns a boolean value.- See Also:
ClauseFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected BoolFunctionfunctionprotected booleanvalue-
Fields inherited from class thredds.server.opendap.servers.AbstractClause
children, constant, defined
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBoolFunctionClause(BoolFunction function, List children)Creates a new BoolFunctionClause.
-
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.BoolFunctiongetFunction()Returns the server-side function invoked by this clausebooleangetValue()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
-
-
-
-
Field Detail
-
function
protected BoolFunction function
-
value
protected boolean value
-
-
Constructor Detail
-
BoolFunctionClause
protected BoolFunctionClause(BoolFunction function, List children) throws DAP2ServerSideException
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 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.
-
getFunction
public BoolFunction getFunction()
Returns the server-side function invoked by this clause
-
printConstraint
public void printConstraint(PrintWriter os)
Prints the original string representation of this clause. For use in debugging.- Specified by:
printConstraintin interfaceClause
-
-