|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopendap.dap.PrimitiveVector
opendap.dap.Int16PrimitiveVector
public class Int16PrimitiveVector
A vector of shorts. (as in 16bit ints :)
PrimitiveVector,
Serialized Form| Constructor Summary | |
|---|---|
Int16PrimitiveVector(BaseType var)
Constructs a new Int16PrimitiveVector. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a clone of this Int16PrimitiveVector. |
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. |
void |
externalize(java.io.DataOutputStream sink,
int start,
int stop,
int stride)
Write a subset of the data to a DataOutputStream. |
java.lang.Object |
getInternalStorage()
Returns (a reference to) the internal storage for this PrimitiveVector object. |
int |
getLength()
Returns the number of elements in the array. |
short |
getValue(int i)
Return the i'th value as a short. |
void |
printSingleVal(java.io.PrintWriter os,
int index)
Prints the value of a single variable in this vector. |
void |
printVal(java.io.PrintWriter os,
java.lang.String space)
Prints the value of all variables in this vector. |
void |
setInternalStorage(java.lang.Object o)
Set the internal storage for PrimitiveVector. |
void |
setLength(int len)
Sets the number of elements in the array. |
void |
setValue(int i,
short newVal)
Set the i'th value of the array. |
PrimitiveVector |
subset(int start,
int stop,
int stride)
Create a new primitive vector using a subset of the data. |
| Methods inherited from class opendap.dap.PrimitiveVector |
|---|
getTemplate, printDecl, printDecl |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Int16PrimitiveVector(BaseType var)
Int16PrimitiveVector.
var - the template BaseType to use.| Method Detail |
|---|
public java.lang.Object clone()
Int16PrimitiveVector. A deep
copy is performed on all data inside the variable.
clone in class PrimitiveVectorInt16PrimitiveVector.public int getLength()
getLength in class PrimitiveVectorpublic void setLength(int len)
deserialize method or in derived
classes on server.
setLength in class PrimitiveVectorlen - the number of elements in the array.public final short getValue(int i)
short.
i - the index of the value to return.
public final void setValue(int i,
short newVal)
i - the index of the value to set.newVal - the new value.
public void printVal(java.io.PrintWriter os,
java.lang.String space)
printVal in class PrimitiveVectoros - 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.BaseType.printVal(PrintWriter, String, boolean)
public void printSingleVal(java.io.PrintWriter os,
int index)
DArray's printVal method.
printSingleVal in class PrimitiveVectoros - the PrintWriter on which to print the value.index - the index of the variable to print.DArray.printVal(PrintWriter, String, boolean)
public void deserialize(java.io.DataInputStream source,
ServerVersion sv,
StatusUI statusUI)
throws java.io.IOException,
java.io.EOFException,
DataReadException
DataInputStream. This method is only used
on the client side of the OPeNDAP client/server connection.
deserialize in interface ClientIOdeserialize in class PrimitiveVectorsource - a DataInputStream to read from.sv - The ServerVersion returned by the server.
(used by DSequence to determine which protocol version was
used).statusUI - The StatusUI object to use for GUI updates
and user cancellation notification (may be null).
DataReadException - when invalid data is read, or if the user
cancels the download.
java.io.EOFException - if EOF is found before the variable is completely
deserialized.
java.io.IOException - thrown on any other InputStream exception.ClientIO.deserialize(DataInputStream, ServerVersion, StatusUI)
public void externalize(java.io.DataOutputStream sink)
throws java.io.IOException
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.
externalize in interface ClientIOexternalize in class PrimitiveVectorsink - a DataOutputStream to write to.
java.io.IOException - thrown on any OutputStream
exception.
public void externalize(java.io.DataOutputStream sink,
int start,
int stop,
int stride)
throws java.io.IOException
DataOutputStream.
sink - a DataOutputStream to write to.start - starting index (i=start)stop - ending index (i<=stop)stride - index stride (i+=stride)
java.io.IOException - thrown on any OutputStream exception.public java.lang.Object getInternalStorage()
getInternalStorage in class PrimitiveVectorpublic void setInternalStorage(java.lang.Object o)
setInternalStorage in class PrimitiveVector
public PrimitiveVector subset(int start,
int stop,
int stride)
subset in class PrimitiveVectorstart - starting index (i=start)stop - ending index (i<=stop)stride - index stride (i+=stride)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||