Package opendap.dap
Class DInt32
- java.lang.Object
-
- opendap.dap.DAPNode
-
- opendap.dap.BaseType
-
- opendap.dap.DPrimitive
-
- opendap.dap.DInt32
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ClientIO
- Direct Known Subclasses:
DUInt32
public class DInt32 extends DPrimitive implements ClientIO
Holds a OPeNDAPInt32
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
.int
getValue()
Get the current value as an int.PrimitiveVector
newPrimitiveVector()
Constructs a newInt32PrimitiveVector
.void
printVal(PrintWriter os, String space, boolean print_decl_p)
Prints the value of the variable, with its declaration.void
setValue(int 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
-
DInt32
public DInt32()
Constructs a newDInt32
.
-
DInt32
public DInt32(String n)
Constructs a newDInt32
with namen
.- Parameters:
n
- the name of the variable.
-
-
Method Detail
-
getValue
public final int getValue()
Get the current value as an int.- Returns:
- the current value.
-
setValue
public final void setValue(int newVal)
Set the current value.- Parameters:
newVal
- the new value.
-
newPrimitiveVector
public PrimitiveVector newPrimitiveVector()
Constructs a newInt32PrimitiveVector
.- Overrides:
newPrimitiveVector
in classBaseType
- Returns:
- a new
Int32PrimitiveVector
.
-
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.
-
-