|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopendap.dap.DAPNode
opendap.dap.PrimitiveVector
opendap.dap.BooleanPrimitiveVector
public class BooleanPrimitiveVector
A vector of booleans.
PrimitiveVector
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class opendap.dap.DAPNode |
---|
DAPNode.CloneMap |
Field Summary |
---|
Fields inherited from class opendap.dap.DAPNode |
---|
_name, _nameEncoded |
Constructor Summary | |
---|---|
BooleanPrimitiveVector(BaseType var)
Constructs a new BooleanPrimitiveVector . |
Method Summary | |
---|---|
DAPNode |
cloneDAG(DAPNode.CloneMap map)
Returns a clone of this BooleanPrimitiveVector . |
void |
deserialize(DataInputStream source,
ServerVersion sv,
StatusUI statusUI)
Reads data from a DataInputStream . |
void |
externalize(DataOutputStream sink)
Writes data to a DataOutputStream . |
void |
externalize(DataOutputStream sink,
int start,
int stop,
int stride)
Write a subset of the data to a DataOutputStream . |
Object |
getInternalStorage()
Returns (a reference to) the internal storage for this PrimitiveVector object. |
int |
getLength()
Returns the number of elements in the array. |
String |
getTypeName()
Returns the OPeNDAP type name of the class instance as a String . |
boolean |
getValue(int i)
Return the i'th value as a double . |
void |
printSingleVal(PrintWriter os,
int index)
Prints the value of a single variable in this vector. |
void |
printVal(PrintWriter os,
String space)
Prints the value of all variables in this vector. |
void |
printVal(PrintWriter os,
String space,
boolean print_decl_p)
Prints the value of the variable, with its declaration. |
void |
setInternalStorage(Object o)
Set the internal storage for PrimitiveVector. |
void |
setLength(int len)
Sets the number of elements in the array. |
void |
setValue(int i,
boolean 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 opendap.dap.DAPNode |
---|
clone, cloneDAG, getClearName, getEncodedName, getParent, isProject, setClearName, setEncodedName, setParent, setProject, setProject, setProjected |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BooleanPrimitiveVector(BaseType var)
BooleanPrimitiveVector
.
var
- the template BaseType
to use.Method Detail |
---|
public int getLength()
getLength
in class PrimitiveVector
public void setLength(int len)
deserialize
method or in derived
classes on server.
setLength
in class PrimitiveVector
len
- the number of elements in the array.public final boolean getValue(int i)
double
.
i
- the index of the value to return.
public final void setValue(int i, boolean newVal)
i
- the index of the value to set.newVal
- the new value.public void printVal(PrintWriter os, String space)
printVal
in class PrimitiveVector
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.BaseType.printVal(PrintWriter, String, boolean)
public void printSingleVal(PrintWriter os, int index)
DArray
's printVal
method.
printSingleVal
in class PrimitiveVector
os
- the PrintWriter
on which to print the value.index
- the index of the variable to print.DArray.printVal(PrintWriter, String, boolean)
public void deserialize(DataInputStream source, ServerVersion sv, StatusUI statusUI) throws IOException, EOFException, DataReadException
DataInputStream
. This method is only used
on the client side of the OPeNDAP client/server connection.
deserialize
in interface ClientIO
deserialize
in class PrimitiveVector
source
- 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.
EOFException
- if EOF is found before the variable is completely
deserialized.
IOException
- thrown on any other InputStream exception.ClientIO.deserialize(DataInputStream, ServerVersion, StatusUI)
public void externalize(DataOutputStream sink) throws IOException
DataOutputStream
. This method is used
on the server side of the OPeNDAP client/server connection, and possibly
by GUI clients which need to download OPeNDAP data, manipulate it, and
then resave it as a binary file.
externalize
in interface ClientIO
externalize
in class PrimitiveVector
sink
- a DataOutputStream
to write to.
IOException
- thrown on any OutputStream
exception.public void externalize(DataOutputStream sink, int start, int stop, int stride) throws IOException
DataOutputStream
.
sink
- a DataOutputStream
to write to.start
- starting index (i=start)stop
- ending index (i<=stop)stride
- index stride (i+=stride)
IOException
- thrown on any OutputStream
exception.public Object getInternalStorage()
getInternalStorage
in class PrimitiveVector
public void setInternalStorage(Object o)
setInternalStorage
in class PrimitiveVector
public PrimitiveVector subset(int start, int stop, int stride)
subset
in class PrimitiveVector
start
- starting index (i=start)stop
- ending index (i<=stop)stride
- index stride (i+=stride)
public String getTypeName()
String
.
getTypeName
in class PrimitiveVector
String
.public void printVal(PrintWriter os, String space, boolean print_decl_p)
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.public DAPNode cloneDAG(DAPNode.CloneMap map) throws CloneNotSupportedException
BooleanPrimitiveVector
.
See DAPNode.cloneDag()
cloneDAG
in class PrimitiveVector
map
- track previously cloned nodes
BooleanPrimitiveVector
.
CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |