Package thredds.server.opendap.servers
Class AbstractClause
- java.lang.Object
-
- thredds.server.opendap.servers.AbstractClause
-
- All Implemented Interfaces:
Clause
- Direct Known Subclasses:
BoolFunctionClause,BTFunctionClause,DereferenceClause,RelOpClause,ValueClause
public abstract class AbstractClause extends Object implements Clause
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.
-
-
Constructor Summary
Constructors Constructor Description AbstractClause()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListgetChildren()Returns an ordered list of this clause's sub-clauses.booleanisConstant()A clause is considered "constant" iff it and its subclauses do not refer to data values from the dataset being constrained.booleanisDefined()Returns 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, wait
-
Methods inherited from interface thredds.server.opendap.servers.Clause
printConstraint
-
-
-
-
Field Detail
-
constant
protected boolean constant
Value to be returned by isConstant(). Should not change for the lifetime of the object.
-
defined
protected boolean defined
Value to be returned by isDefined(). May change during the lifetime of the object.
-
children
protected List 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.
-
-
Method Detail
-
getChildren
public List 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.
-
-