DoubleDataPackage Class

Package : cam.dataxchg


Instances of this class provide encapsulation for one and two-dimensional arrays of double values.

Class Reference

 

Chris Anderson © UCLA 1997


 

Constructor

DoubleDataPackage()

Constructs a DoubleDataPackage instance.

 

Set Methods

void setData(double [] D)

Sets the data of the DoubleDataPackage instance to a copy of the data in the one-dimensional Java double array D.

void setData(double [] D, int m, int n)

Sets the data of the DoubleDataPackage instance to be a two-dimensional array of size m by n, with data provided by the values in the one-dimensional Java double array D.

void setData(double [][] D)

Sets the data of the DoubleDataPackage instance to be a two-dimensional array data provided by the values in the two-dimensional Java double array D.

 

 

Get Methods

int [] getDimensions()

Returns the dimension of the data (either 1 or 2).

double [] getDataAs1DArray()

Returns a copy of the data as a one dimensional Java double array.

double [][] getDataAs2DArray()

Returns a copy of the data as a two dimensional Java double array.

double [] getDataReference()

Returns the one dimensional Java array in which the data is stored.

 

 

Input/Output

void input(InputStream D)

Extracts from D a DoubleDataPackage which was output in text (ascii) form using output(…).

void inputBinary(InputStream D)

Extracts from D a DoubleDataPackage which was output in binary form using outputBinary(…).

void output(OutputStream O)

Outputs to D a DoubleDataPackage in text (ascii) form.

void outputBinary(OutputStream D)

Outputs to D a DoubleDataPackage in binary form.