Package opendap.dap
Class DAS
- java.lang.Object
-
- opendap.dap.DAPNode
-
- opendap.dap.AttributeTable
-
- opendap.dap.DAS
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class DAS extends AttributeTable
The Data Attribute Structure is a set of name-value pairs used to describe the data in a particular dataset. The name-value pairs are called the "attributes." The values may be of any of the OPeNDAP simple data types (DByte, DInt32, DUInt32, DFloat64, DString and DURL), and may be scalar or vector. (Note that all values are actually stored as string data.) A value may also consist of a set of other name-value pairs. This makes it possible to nest collections of attributes, giving rise to a hierarchy of attributes. OPeNDAP uses this structure to provide information about variables in a dataset. In the following example of a DAS, several of the attribute collections have names corresponding to the names of variables in a hypothetical dataset. The attributes in that collection are said to belong to that variable. For example, thelat
variable has an attributeunits
ofdegrees_north
.Attributes { GLOBAL { String title "Reynolds Optimum Interpolation (OI) SST"; } lat { String units "degrees_north"; String long_name "Latitude"; Float64 actual_range 89.5, -89.5; } lon { String units "degrees_east"; String long_name "Longitude"; Float64 actual_range 0.5, 359.5; } time { String units "days since 1-1-1 00:00:00"; String long_name "Time"; Float64 actual_range 726468., 729289.; String delta_t "0000-00-07 00:00:00"; } sst { String long_name "Weekly Means of Sea Surface Temperature"; Float64 actual_range -1.8, 35.09; String units "degC"; Float64 add_offset 0.; Float64 scale_factor 0.0099999998; Int32 missing_value 32767; } }
GLOBAL
attribute provides information about the entire dataset. Data attribute information is an important part of the the data provided to a OPeNDAP client by a server, and the DAS is how this data is packaged for sending (and how it is received).- See Also:
DDS
,AttributeTable
,Attribute
, 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 DAS()
Create a new emptyDAS
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttributeTable(String name, AttributeTable a)
Adds anAttributeTable
to the DAS.DAPNode
cloneDAG(DAPNode.CloneMap map)
Returns a clone of thisAttribute
.AttributeTable
getAttributeTable(String name)
Returns theAttributeTable
with the given name.AttributeTable
getAttributeTableN(String name)
Returns theAttributeTable
with the given name.boolean
parse(InputStream stream)
boolean
parse(String text)
void
resolveAliases()
This method searchs through theDAS
for Alias members.-
Methods inherited from class opendap.dap.AttributeTable
addAlias, addContainer, appendAttribute, appendAttribute, appendContainer, delAttribute, delAttribute, getAttribute, getNames, hasAttribute, print, print, print, print, print, printXML, printXML, printXML, printXML, size
-
Methods inherited from class opendap.dap.DAPNode
clone, cloneDAG, getClearName, getEncodedName, getParent, isProject, setClearName, setEncodedName, setParent, setProject, setProject, setProjected
-
-
-
-
Method Detail
-
parse
public boolean parse(InputStream stream) throws ParseException, DAP2Exception
- Throws:
ParseException
DAP2Exception
-
parse
public boolean parse(String text) throws ParseException, DAP2Exception
- Throws:
ParseException
DAP2Exception
-
getAttributeTable
public final AttributeTable getAttributeTable(String name) throws NoSuchAttributeException
Returns theAttributeTable
with the given name.- Parameters:
name
- the name of theAttributeTable
to return.- Returns:
- the
AttributeTable
with the specified name, or null if there is no matchingAttributeTable
. - Throws:
NoSuchAttributeException
- There is no AttributeTable with the passed name.- See Also:
AttributeTable
-
getAttributeTableN
public final AttributeTable getAttributeTableN(String name)
Returns theAttributeTable
with the given name.- Parameters:
name
- the name of theAttributeTable
to return.- Returns:
- the
AttributeTable
with the specified name, or null if there is no matchingAttributeTable
. - See Also:
AttributeTable
-
addAttributeTable
public void addAttributeTable(String name, AttributeTable a) throws AttributeExistsException
Adds anAttributeTable
to the DAS.- Parameters:
name
- the name of theAttributeTable
to add.a
- theAttributeTable
to add.- Throws:
AttributeExistsException
- See Also:
AttributeTable
-
resolveAliases
public void resolveAliases() throws MalformedAliasException, UnresolvedAliasException, NoSuchAttributeException
This method searchs through theDAS
for Alias members. When an Alias is found the method attempts to resolve it to a specific Attribute. This method is invoked byparse(InputStream is)
, and is used to search for Aliases in AttributeTables found in the DAS. If you are building a DAS from it's API it is important to call this method prior to returning said DAS to an application. If this call is not made, Aliases will not work correctly.
-
cloneDAG
public DAPNode cloneDAG(DAPNode.CloneMap map) throws CloneNotSupportedException
Returns a clone of thisAttribute
. See DAPNode.cloneDag()- Overrides:
cloneDAG
in classAttributeTable
- Parameters:
map
- track previously cloned nodes- Returns:
- a clone of this
Attribute
. - Throws:
CloneNotSupportedException
-
-