Package opendap.servers
Class AbstractClause
java.lang.Object
opendap.servers.AbstractClause
- All Implemented Interfaces:
Clause
- Direct Known Subclasses:
BoolFunctionClause,BTFunctionClause,DereferenceClause,RelOpClause,ValueClause
Provides default implementations for the Clause interface methods.
This eliminates redundant code and provides a starting point
for new implementations of Clause.
Note that every Clause object is expected to implement either SubClause or TopLevelClause. No default implementations are provided for the methods of these subinterfaces
Also note that it is not necessary to use this class to create your own implementations, it's just a convenience.
The class has no abstract methods, but is declared abstract because it should not be directly instantiated.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an ordered list of this clause's sub-clauses.booleanA clause is considered "constant" iff it and its subclauses do not refer to data values from the dataset being constrained.booleanReturns whether or not the clause has a defined value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface opendap.servers.Clause
printConstraint
-
Field Details
-
constant
protected boolean constantValue to be returned by isConstant(). Should not change for the lifetime of the object. -
defined
protected boolean definedValue to be returned by isDefined(). May change during the lifetime of the object. -
children
A list of SubClause objects representing the sub-clauses of this clause. Use caution when modifying this list other than at the point of creation, since methods such as evaluate() depend on it.
-
-
Constructor Details
-
AbstractClause
public AbstractClause()
-
-
Method Details
-
getChildren
Description copied from interface:ClauseReturns an ordered list of this clause's sub-clauses. If the clause has no sub-clauses, an empty list will be returned.- Specified by:
getChildrenin interfaceClause
-
isConstant
public boolean isConstant()Description copied from interface:ClauseA clause is considered "constant" iff it and its subclauses do not refer to data values from the dataset being constrained. A constant clause is defined as soon as it is created, and is guaranteed not to change its value during its lifetime.- Specified by:
isConstantin interfaceClause
-
isDefined
public boolean isDefined()Description copied from interface:ClauseReturns whether or not the clause has a defined value. Non-constant clauses do not have a defined value until they are evaluated for the first time. Methods for evaluating are found in the TopLevelClause and SubClause interfaces.
-