Package opendap.dap
Class DataDDS
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ClientIO
public class DataDDS extends DDS
The DataDDS class extends DDS to add new methods for retrieving data from the server, and printing out the contents of the data.- See Also:
DDS
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class opendap.dap.DAPNode
DAPNode.CloneMap
-
-
Field Summary
-
Fields inherited from class opendap.dap.DStructure
vars
-
Fields inherited from class opendap.dap.DAPNode
_nameClear, _nameEncoded, log
-
-
Constructor Summary
Constructors Constructor Description DataDDS(ServerVersion ver)
Construct the DataDDS with the given server version.DataDDS(ServerVersion ver, BaseTypeFactory btf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
externalize(OutputStream os, boolean compress, boolean headers)
Dump the dataset using externalize methods.ServerVersion
getServerVersion()
Returns theServerVersion
given in the constructor.boolean
parse(InputStream stream)
void
printVal(OutputStream os)
Print the dataset using OutputStream.void
printVal(PrintWriter pw)
Print the dataset just read.void
readData(InputStream is, StatusUI statusUI)
Read the data stream from the given InputStream.-
Methods inherited from class opendap.dap.DDS
addVariable, checkForAttributeNameConflict, checkSemantics, cloneDAG, delVariable, getBlobContentID, getDAS, getDDSText, getDDXText, getFactory, getVariable, getVariables, ingestDAS, normalize, numVariables, parse, parseXML, parseXML, print, print, printDAS, printDAS, printXML, printXML, resolveAliases, search, setBlobContentID, setFactory, setURL, tokenizeAliasField
-
Methods inherited from class opendap.dap.DStructure
deserialize, elementCount, externalize, getTypeName, getVar, getVarCount, getVariableSet, printDecl, printVal
-
Methods inherited from class opendap.dap.DConstructor
addVariable, someChildHasAttributes
-
Methods inherited from class opendap.dap.BaseType
addAttributeAlias, addAttributeContainer, appendAttribute, appendAttribute, appendAttributeContainer, checkSemantics, delAttribute, delAttribute, elementCount, getAttribute, getAttribute, getAttributeNames, getAttributeTable, getLongName, hasAttributes, newPrimitiveVector, printAttributes, printAttributes, printAttributes, printAttributes, printConstraint, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printXML, printXML, printXML, setClearName
-
Methods inherited from class opendap.dap.DAPNode
clone, cloneDAG, getClearName, getEncodedName, getParent, isProject, setEncodedName, setParent, setProject, setProject, setProjected
-
-
-
-
Constructor Detail
-
DataDDS
public DataDDS(ServerVersion ver)
Construct the DataDDS with the given server version.- Parameters:
ver
- the ServerVersion returned from the open OPeNDAP connection.
-
DataDDS
public DataDDS(ServerVersion ver, BaseTypeFactory btf)
-
-
Method Detail
-
getServerVersion
public final ServerVersion getServerVersion()
Returns theServerVersion
given in the constructor.- Returns:
- the
ServerVersion
given in the constructor.
-
parse
public boolean parse(InputStream stream) throws ParseException, DAP2Exception
- Overrides:
parse
in classDDS
- Throws:
ParseException
DAP2Exception
-
readData
public void readData(InputStream is, StatusUI statusUI) throws IOException, EOFException, DAP2Exception
Read the data stream from the given InputStream. In the C++ version, this code was in Connect.- Parameters:
is
- the InputStream to read fromstatusUI
- the StatusUI object to use, or null- Throws:
EOFException
- if EOF is found before the variable is completely deserialized.IOException
- thrown on any other InputStream exception.DataReadException
- when invalid data is read, or if the user cancels the download.DAP2Exception
- if the OPeNDAP server returned an error.
-
printVal
public void printVal(PrintWriter pw)
Print the dataset just read. In the C++ version, this code was ingeturl
.- Parameters:
pw
- thePrintWriter
to use.
-
printVal
public final void printVal(OutputStream os)
Print the dataset using OutputStream.- Parameters:
os
- theOutputStream
to use.
-
externalize
public final void externalize(OutputStream os, boolean compress, boolean headers) throws IOException
Dump the dataset using externalize methods. This should create a multipart Mime document with the binary representation of the DDS that is currently in memory.- Parameters:
os
- theOutputStream
to use.compress
-true
if we should compress the output.headers
-true
if we should print HTTP headers.- Throws:
IOException
- thrown on anyOutputStream
exception.
-
-