Class BoolFunctionClause

java.lang.Object
opendap.servers.AbstractClause
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:
  • Field Details

    • function

      protected BoolFunction function
    • value

      protected boolean value
  • Constructor Details

    • BoolFunctionClause

      protected BoolFunctionClause(BoolFunction function, List children) throws DAP2ServerSideException
      Creates a new BoolFunctionClause.
      Parameters:
      function - The function invoked by the clause
      children - 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: 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 DAP2ServerSideException
      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:
      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:
      printConstraint in interface Clause