## dods.dap
Class DConstructor

    java.lang.Object
      dods.dap.BaseType
          dods.dap.DConstructor

All Implemented Interfaces:
  Cloneable

Direct Known Subclasses:
  DGrid, DSequence, DStructure

public abstract class DConstructor
extends BaseType

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

See Also:
  `DStructure`, `DSequence`, `DGrid`, `DList`

Constructor Summary
`DConstructor()` Constructs a new `DConstructor`.
`DConstructor(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(String name)` Gets the named variable.
`abstract Enumeration` `getVariables()` Return an Enumeration that can be used to iterate over all of the members of the class.

Methods inherited from class dods.dap.BaseType
`checkSemantics, checkSemantics, clone, elementCount, elementCount, getLongName, getName, getParent, getTypeName, newPrimitiveVector, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printVal, 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(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(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 `Vector`s.

  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 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.