Package opendap.dap
Class DFloat32
- java.lang.Object
-
- opendap.dap.DAPNode
-
- opendap.dap.BaseType
-
- opendap.dap.DPrimitive
-
- opendap.dap.DFloat32
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ClientIO
public class DFloat32 extends DPrimitive implements ClientIO
Holds a OPeNDAPFLoat32
value.- 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 void
deserialize(DataInputStream source, ServerVersion sv, StatusUI statusUI)
Reads data from aDataInputStream
.void
externalize(DataOutputStream sink)
Writes data to aDataOutputStream
.String
getTypeName()
Returns the OPeNDAP type name of the class instance as aString
.float
getValue()
Get the current value as a float.PrimitiveVector
newPrimitiveVector()
Constructs a newFloat32PrimitiveVector
.void
printVal(PrintWriter os, String space, boolean print_decl_p)
Prints the value of the variable, with its declaration.void
setValue(float 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, printAttributes, printAttributes, printAttributes, printAttributes, printConstraint, 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
-
DFloat32
public DFloat32()
Constructs a newDFloat32
.
-
DFloat32
public DFloat32(String n)
Constructs a newDFloat32
with namen
.- Parameters:
n
- the name of the variable.
-
-
Method Detail
-
getValue
public final float getValue()
Get the current value as a float.- Returns:
- the current value.
-
setValue
public final void setValue(float newVal)
Set the current value.- Parameters:
newVal
- the new value.
-
newPrimitiveVector
public PrimitiveVector newPrimitiveVector()
Constructs a newFloat32PrimitiveVector
.- Overrides:
newPrimitiveVector
in classBaseType
- Returns:
- a new
Float32PrimitiveVector
.
-
getTypeName
public String getTypeName()
Returns the OPeNDAP type name of the class instance as aString
.- Specified by:
getTypeName
in 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:
printVal
in classBaseType
- Parameters:
os
- thePrintWriter
on which to print the value.space
- this value is passed to theprintDecl
method, 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
Reads data from aDataInputStream
. This method is only used on the client side of the OPeNDAP client/server connection.- Specified by:
deserialize
in interfaceClientIO
- Parameters:
source
- aDataInputStream
to read from.sv
- theServerVersion
returned by the server.statusUI
- theStatusUI
object 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.- 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:
externalize
in interfaceClientIO
- Parameters:
sink
- aDataOutputStream
to write to.- Throws:
IOException
- thrown on anyOutputStream
exception.
-
-