dods.dap.Server
Class BoolFunctionClause
java.lang.Object
dods.dap.Server.AbstractClause
dods.dap.Server.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.
- Author:
- joew
- See Also:
ClauseFactory
Method Summary |
boolean |
evaluate()
Evaluates the clause, first calling evaluate() on any sub-clauses it
contains. |
BoolFunction |
getFunction()
Returns the server-side function invoked by this clause |
boolean |
getValue()
Returns the current value of the clause. |
String |
toString()
Prints the original string representation of this clause. |
function
protected BoolFunction function
value
protected boolean value
BoolFunctionClause
protected BoolFunctionClause(BoolFunction function,
List children)
throws SDODSException
- 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:
SDODSException
- 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.
getValue
public boolean getValue()
- Description copied from interface:
TopLevelClause
- Returns the current value of the clause. The value of non-constant
Clauses is undefined until the evaluate() method has been called.
- Specified by:
getValue
in interface TopLevelClause
evaluate
public boolean evaluate()
throws SDODSException
- Description copied from interface:
TopLevelClause
- Evaluates 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:
evaluate
in interface TopLevelClause
- Throws:
SDODSException
- Thrown if the evaluation fails for any reason.
getFunction
public BoolFunction getFunction()
- Returns the server-side function invoked by this clause
toString
public String toString()
- Prints the original string representation of this clause.
For use in debugging.
- Overrides:
toString
in class Object