dods.dap.Server
Class ValueClause

java.lang.Object
  extended by dods.dap.Server.AbstractClause
      extended by dods.dap.Server.ValueClause
All Implemented Interfaces:
Clause, SubClause

public class ValueClause
extends AbstractClause
implements SubClause

Represents a clause containing a simple value. If the value is an constant value such as "2.0", the clause's isConstant() method will return true; if it is a variable of the dataset, isConstant() will return false.

Author:
Joe Wielgosz (joew@cola.iges.org)
See Also:
ClauseFactory

Field Summary
protected  Clause parent
           
protected  dods.dap.BaseType value
           
 
Fields inherited from class dods.dap.Server.AbstractClause
children, constant, defined
 
Constructor Summary
protected ValueClause(dods.dap.BaseType value, boolean constant)
          Creates a new ValueClause.
 
Method Summary
 dods.dap.BaseType evaluate()
          Returns the BaseType represented by this clause.
 Clause getParent()
          Returns the Clause which contains this subclause.
 dods.dap.BaseType getValue()
          Returns the BaseType represented by this clause.
 void setParent(Clause parent)
          Sets the parent of this subclause.
 String toString()
          Prints the original string representation of this clause.
 
Methods inherited from class dods.dap.Server.AbstractClause
getChildren, isConstant, isDefined
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface dods.dap.Server.Clause
getChildren, isConstant, isDefined
 

Field Detail

value

protected dods.dap.BaseType value

parent

protected Clause parent
Constructor Detail

ValueClause

protected ValueClause(dods.dap.BaseType value,
                      boolean constant)
Creates a new ValueClause.

Parameters:
value - The BaseType represented by this clause. This can be either a BaseType taken from the DDS of a dataset, or a BaseType object created to hold a constant value.
constant - Should be set to false if the value parameter is from the DDS of a dataset, and true if the value parameter is a constant value.
Method Detail

getValue

public dods.dap.BaseType getValue()
Returns the BaseType represented by this clause.

Specified by:
getValue in interface SubClause

evaluate

public dods.dap.BaseType evaluate()
Returns the BaseType represented by this clause. Equivalent to getValue(), except that calling this method flags this clause as "defined".

Specified by:
evaluate in interface SubClause
Throws:
SDODSException - Not thrown by this type of clause.

getParent

public Clause getParent()
Description copied from interface: SubClause
Returns the Clause which contains this subclause. The clause returned may be a TopLevelClause or another SubClause.

Specified by:
getParent in interface SubClause

setParent

public void setParent(Clause parent)
Description copied from interface: SubClause
Sets the parent of this subclause. Used during parsing.

Specified by:
setParent in interface SubClause

toString

public String toString()
Prints the original string representation of this clause. For use in debugging.

Overrides:
toString in class Object