Package opendap.dap
Class DString
- java.lang.Object
-
- opendap.dap.DAPNode
-
- opendap.dap.BaseType
-
- opendap.dap.DPrimitive
-
- opendap.dap.DString
-
- All Implemented Interfaces:
Serializable,Cloneable,ClientIO
- Direct Known Subclasses:
DURL
public class DString extends DPrimitive implements ClientIO
Holds a OPeNDAPStringvalue.- See Also:
BaseType, 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeserialize(DataInputStream source, ServerVersion sv, StatusUI statusUI)Reads data from aDataInputStream.voidexternalize(DataOutputStream sink)Writes data to aDataOutputStream.StringgetTypeName()Returns the OPeNDAP type name of the class instance as aString.StringgetValue()Get the current value as aString.voidprintConstraint(PrintWriter os)voidprintVal(PrintWriter os, String space, boolean print_decl_p)Prints the value of the variable, with its declaration.voidsetValue(String newVal)Set the current value.-
Methods inherited from class opendap.dap.BaseType
addAttributeAlias, addAttributeContainer, appendAttribute, appendAttribute, appendAttributeContainer, checkSemantics, checkSemantics, cloneDAG, delAttribute, delAttribute, elementCount, elementCount, getAttribute, getAttribute, getAttributeNames, getAttributeTable, getLongName, hasAttributes, newPrimitiveVector, printAttributes, printAttributes, printAttributes, printAttributes, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printXML, 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
-
DString
public DString()
Constructs a newDString.
-
DString
public DString(String n)
Constructs a newDStringwith namen.- Parameters:
n- the name of the variable.
-
-
Method Detail
-
getValue
public final String getValue()
Get the current value as aString.- Returns:
- the current value.
-
setValue
public final void setValue(String newVal)
Set the current value.- Parameters:
newVal- the new value.
-
getTypeName
public String getTypeName()
Returns the OPeNDAP type name of the class instance as aString.- Specified by:
getTypeNamein classBaseType- Returns:
- the OPeNDAP type name of the class instance as a
String.
-
printVal
public void printVal(PrintWriter os, String space, boolean print_decl_p)
Prints the value of the variable, with its declaration. This function is primarily intended for debugging OPeNDAP applications and text-based clients such as geturl.- Specified by:
printValin classBaseType- Parameters:
os- thePrintWriteron which to print the value.space- this value is passed to theprintDeclmethod, and controls the leading spaces of the output.print_decl_p- a boolean value controlling whether the variable declaration is printed as well as the value.- See Also:
BaseType.printVal(PrintWriter, String, boolean)
-
deserialize
public void deserialize(DataInputStream source, ServerVersion sv, StatusUI statusUI) throws IOException, EOFException, DataReadException
Reads data from aDataInputStream. This method is only used on the client side of the OPeNDAP client/server connection.- Specified by:
deserializein interfaceClientIO- Parameters:
source- aDataInputStreamto read from.sv- theServerVersionreturned by the server.statusUI- theStatusUIobject to use for GUI updates and user cancellation notification (may be null).- Throws:
EOFException- if EOF is found before the variable is completely deserialized.IOException- thrown on any other InputStream exception.DataReadException- if a negative string length was read.- See Also:
ClientIO.deserialize(DataInputStream, ServerVersion, StatusUI)
-
externalize
public void externalize(DataOutputStream sink) throws IOException
Writes data to aDataOutputStream. This method is used primarily by GUI clients which need to download OPeNDAP data, manipulate it, and then re-save it as a binary file.- Specified by:
externalizein interfaceClientIO- Parameters:
sink- aDataOutputStreamto write to.- Throws:
IOException- thrown on anyOutputStreamexception.
-
printConstraint
public void printConstraint(PrintWriter os)
- Overrides:
printConstraintin classBaseType
-
-