opendap.dap
Class DByte

java.lang.Object
  extended by opendap.dap.BaseType
      extended by opendap.dap.DByte
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ClientIO
Direct Known Subclasses:
asciiByte, SDByte, wwwByte

public class DByte
extends BaseType
implements ClientIO

Holds a OPeNDAP Byte value.

Version:
$Revision: 23881 $
Author:
jehamby
See Also:
BaseType, Serialized Form

Constructor Summary
DByte()
          Constructs a new DByte.
DByte(java.lang.String n)
          Constructs a new DByte with name n.
 
Method Summary
 void deserialize(java.io.DataInputStream source, ServerVersion sv, StatusUI statusUI)
          Reads data from a DataInputStream.
 void externalize(java.io.DataOutputStream sink)
          Writes data to a DataOutputStream.
 java.lang.String getTypeName()
          Returns the OPeNDAP type name of the class instance as a String.
 byte getValue()
          Get the current value as a byte.
 PrimitiveVector newPrimitiveVector()
          Constructs a new BytePrimitiveVector.
 void printVal(java.io.PrintWriter os, java.lang.String space, boolean print_decl_p)
          Prints the value of the variable, with its declaration.
 void setValue(byte newVal)
          Set the current value.
 
Methods inherited from class opendap.dap.BaseType
addAttributeAlias, addAttributeContainer, appendAttribute, appendAttribute, appendAttributeContainer, checkSemantics, checkSemantics, clone, delAttribute, delAttribute, elementCount, elementCount, getAttribute, getAttribute, getAttributeNames, getAttributeTable, getClearName, getLongName, getName, getParent, hasAttributes, printAttributes, printAttributes, printAttributes, printAttributes, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, printXML, printXML, printXML, printXML, printXML, setClearName, setName, setParent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DByte

public DByte()
Constructs a new DByte.


DByte

public DByte(java.lang.String n)
Constructs a new DByte with name n.

Parameters:
n - the name of the variable.
Method Detail

getValue

public final byte getValue()
Get the current value as a byte.

Returns:
the current value.

setValue

public final void setValue(byte newVal)
Set the current value.

Parameters:
newVal - the new value.

newPrimitiveVector

public PrimitiveVector newPrimitiveVector()
Constructs a new BytePrimitiveVector.

Overrides:
newPrimitiveVector in class BaseType
Returns:
a new BytePrimitiveVector.

getTypeName

public java.lang.String getTypeName()
Returns the OPeNDAP type name of the class instance as a String.

Specified by:
getTypeName in class BaseType
Returns:
the OPeNDAP type name of the class instance as a String.

printVal

public void printVal(java.io.PrintWriter os,
                     java.lang.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 class BaseType
Parameters:
os - the PrintWriter on which to print the value.
space - this value is passed to the printDecl 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(java.io.DataInputStream source,
                        ServerVersion sv,
                        StatusUI statusUI)
                 throws java.io.IOException,
                        java.io.EOFException
Reads data from a DataInputStream. This method is only used on the client side of the OPeNDAP client/server connection.

Specified by:
deserialize in interface ClientIO
Parameters:
source - a DataInputStream to read from.
sv - the ServerVersion returned by the server.
statusUI - the StatusUI object to use for GUI updates and user cancellation notification (may be null).
Throws:
java.io.EOFException - if EOF is found before the variable is completely deserialized.
java.io.IOException - thrown on any other InputStream exception.
See Also:
ClientIO.deserialize(DataInputStream, ServerVersion, StatusUI)

externalize

public void externalize(java.io.DataOutputStream sink)
                 throws java.io.IOException
Writes data to a DataOutputStream. 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 interface ClientIO
Parameters:
sink - a DataOutputStream to write to.
Throws:
java.io.IOException - thrown on any OutputStream exception.