opendap.dap
Class DConstructor

java.lang.Object
  extended by opendap.dap.BaseType
      extended by opendap.dap.DConstructor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DGrid, DSequence, DStructure

public abstract class DConstructor
extends BaseType

Contains methods used only by the OPeNDAP constructor classes (DStructure, DSequence, DGrid, and DList).

Version:
$Revision: 23881 $
Author:
jehamby
See Also:
DStructure, DSequence, DGrid, Serialized Form

Constructor Summary
DConstructor()
          Constructs a new DConstructor.
DConstructor(java.lang.String n)
          Constructs a new DConstructor with the given name.
 
Method Summary
 void addVariable(BaseType v)
          Adds a variable to the container.
abstract  void addVariable(BaseType v, int part)
          Adds a variable to the container.
abstract  BaseType getVar(int index)
          Gets the indexed variable.
abstract  BaseType getVariable(java.lang.String name)
          Gets the named variable.
abstract  java.util.Enumeration getVariables()
          Return an Enumeration that can be used to iterate over all of the members of the class.
 void printXML(java.io.PrintWriter pw, java.lang.String pad, boolean constrained)
           
protected  boolean someChildHasAttributes(BaseType bt)
           
 
Methods inherited from class opendap.dap.BaseType
addAttributeAlias, addAttributeContainer, appendAttribute, appendAttribute, appendAttributeContainer, checkSemantics, checkSemantics, clone, delAttribute, delAttribute, elementCount, elementCount, getAttribute, getAttribute, getAttributeNames, getAttributeTable, getClearName, getLongName, getName, getParent, getTypeName, hasAttributes, newPrimitiveVector, printAttributes, printAttributes, printAttributes, printAttributes, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printVal, printXML, printXML, printXML, printXML, setClearName, setName, setParent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DConstructor

public DConstructor()
Constructs a new DConstructor.


DConstructor

public DConstructor(java.lang.String n)
Constructs a new DConstructor with the given name.

Parameters:
n - The name of the variable.
Method Detail

addVariable

public abstract void addVariable(BaseType v,
                                 int part)
Adds a variable to the container.

Parameters:
v - the variable to add.
part - The part of the constructor data to be modified.

addVariable

public final void addVariable(BaseType v)
Adds a variable to the container. Same as addVariable(v, 0).

Parameters:
v - the variable to add.

getVariable

public abstract BaseType getVariable(java.lang.String name)
                              throws NoSuchVariableException
Gets the named variable.

Parameters:
name - the name of the variable.
Returns:
the named variable.
Throws:
NoSuchVariableException - if the named variable does not exist in this container.

getVar

public abstract BaseType getVar(int index)
                         throws NoSuchVariableException
Gets the indexed variable. For a DGrid the index 0 returns the DArray and indexes 1 and higher return the associated map Vectors.

Parameters:
index - the index of the variable in the Vector Vars.
Returns:
the named variable.
Throws:
NoSuchVariableException - if the named variable does not exist in this container.

getVariables

public abstract java.util.Enumeration getVariables()
Return an Enumeration that can be used to iterate over all of the members of the class. Each implementation must define what this means. The intent of this method is to support operations on all members of a Structure, Seqeunce or Grid that can be performed equally. So it is not necessary that this methods be usable, for example, when the caller needs to know that it s dealing with the Array part of a grid.

Returns:
An Enumeration object.

someChildHasAttributes

protected boolean someChildHasAttributes(BaseType bt)
Parameters:
bt - The BasType object to search.
Returns:
true if some child of the passed BaseType has attributes

This class/method is associated with pre-release version of the DDX API. It is experimental and is subject to (significant) change.


printXML

public void printXML(java.io.PrintWriter pw,
                     java.lang.String pad,
                     boolean constrained)
Overrides:
printXML in class BaseType
Parameters:
pw - Where to print
pad - Padding for iondentation (makes the output easier for humans to read).
constrained - If true then only projected variables (and their Attributes) will be printed.

This class/method is associated with pre-release version of the DDX API. It is experimental and is subject to (significant) change.