Package opendap.dap
Class DConstructor
- java.lang.Object
-
- opendap.dap.DAPNode
-
- opendap.dap.BaseType
-
- opendap.dap.DConstructor
-
- All Implemented Interfaces:
Serializable,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, andDList).- See Also:
DStructure,DSequence,DGrid, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class opendap.dap.DAPNode
DAPNode.CloneMap
-
-
Field Summary
-
Fields inherited from class opendap.dap.DAPNode
_nameClear, _nameEncoded, log
-
-
Constructor Summary
Constructors Constructor Description DConstructor()Constructs a newDConstructor.DConstructor(String n)Constructs a newDConstructorwith the given name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddVariable(BaseType v)Adds a variable to the container.abstract voidaddVariable(BaseType v, int part)Adds a variable to the container.abstract BaseTypegetVar(int index)Gets the indexed variable.abstract intgetVarCount()Get the number of contained variables (for use with getVar()abstract BaseTypegetVariable(String name)Gets the named variable.abstract EnumerationgetVariables()Return an Enumeration that can be used to iterate over all of the members of the class.voidprintXML(PrintWriter pw, String pad, boolean constrained)protected booleansomeChildHasAttributes(BaseType bt)-
Methods inherited from class opendap.dap.BaseType
addAttributeAlias, addAttributeContainer, appendAttribute, appendAttribute, appendAttributeContainer, checkSemantics, checkSemantics, cloneDAG, delAttribute, delAttribute, elementCount, elementCount, getAttribute, getAttribute, getAttributeNames, getAttributeTable, getLongName, getTypeName, hasAttributes, newPrimitiveVector, printAttributes, printAttributes, printAttributes, printAttributes, printConstraint, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printVal, printXML, printXML, printXML, printXML, setClearName
-
Methods inherited from class opendap.dap.DAPNode
clone, cloneDAG, getClearName, getEncodedName, getParent, isProject, setEncodedName, setParent, setProject, setProject, setProjected
-
-
-
-
Constructor Detail
-
DConstructor
public DConstructor()
Constructs a newDConstructor.
-
DConstructor
public DConstructor(String n)
Constructs a newDConstructorwith 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 asaddVariable(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 theDArrayand indexes 1 and higher return the associated mapVectors.- Parameters:
index- the index of the variable in theVectorVars.- Returns:
- the named variable.
- Throws:
NoSuchVariableException- if the named variable does not exist in this container.
-
getVarCount
public abstract int getVarCount()
Get the number of contained variables (for use with getVar()- Returns:
- the number of contained variables
-
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.
-
someChildHasAttributes
protected boolean someChildHasAttributes(BaseType bt)
- Parameters:
bt- The BasType object to search.- Returns:
- true if some child of the passed BaseType has attributes
-
printXML
public void printXML(PrintWriter pw, String pad, boolean constrained)
-
-