DataBufferDoublepublic final class DataBufferDouble extends DataBuffer This class extends DataBuffer and stores data internally
in double form. |
Fields Summary |
---|
double[] | bankdataThe array of data banks. | double[] | dataA reference to the default data bank. |
Constructors Summary |
---|
public DataBufferDouble(int size)Constructs a double -based DataBuffer
with a specified size.
super(TYPE_DOUBLE, size);
data = new double[size];
bankdata = new double[1][];
bankdata[0] = data;
| public DataBufferDouble(int size, int numBanks)Constructs a double -based DataBuffer
with a specified number of banks, all of which are of a
specified size.
super(TYPE_DOUBLE, size, numBanks);
bankdata = new double[numBanks][];
for (int i= 0; i < numBanks; i++) {
bankdata[i] = new double[size];
}
data = bankdata[0];
| public DataBufferDouble(double[] dataArray, int size)Constructs a double -based DataBuffer
with the specified data array. Only the first
size elements are available for use by this
DataBuffer . The array must be large enough to
hold size elements.
super(TYPE_DOUBLE, size);
data = dataArray;
bankdata = new double[1][];
bankdata[0] = data;
| public DataBufferDouble(double[] dataArray, int size, int offset)Constructs a double -based DataBuffer
with the specified data array. Only the elements between
offset and offset + size - 1 are
available for use by this DataBuffer . The array
must be large enough to hold offset + size elements.
super(TYPE_DOUBLE, size, 1, offset);
data = dataArray;
bankdata = new double[1][];
bankdata[0] = data;
| public DataBufferDouble(double[] dataArray, int size)Constructs a double -based DataBuffer
with the specified data arrays. Only the first
size elements of each array are available for use
by this DataBuffer . The number of banks will be
equal to dataArray.length .
super(TYPE_DOUBLE, size, dataArray.length);
bankdata = (double[][]) dataArray.clone();
data = bankdata[0];
| public DataBufferDouble(double[] dataArray, int size, int[] offsets)Constructs a double -based DataBuffer
with the specified data arrays, size, and per-bank offsets.
The number of banks is equal to dataArray.length. Each array
must be at least as large as size plus the
corresponding offset. There must be an entry in the
offsets array for each data array.
super(TYPE_DOUBLE, size, dataArray.length, offsets);
bankdata = (double[][]) dataArray.clone();
data = bankdata[0];
|
Methods Summary |
---|
public double[][] | getBankData()Returns the data array for all banks.
return (double[][]) bankdata.clone();
| public double[] | getData()Returns the default (first) double data array.
return data;
| public double[] | getData(int bank)Returns the data array for the specified bank.
return bankdata[bank];
| public int | getElem(int i)Returns the requested data array element from the first
(default) bank as an int .
return (int)(data[i+offset]);
| public int | getElem(int bank, int i)Returns the requested data array element from the specified
bank as an int .
return (int)(bankdata[bank][i+offsets[bank]]);
| public double | getElemDouble(int i)Returns the requested data array element from the first
(default) bank as a double .
return data[i+offset];
| public double | getElemDouble(int bank, int i)Returns the requested data array element from the specified
bank as a double .
return bankdata[bank][i+offsets[bank]];
| public float | getElemFloat(int i)Returns the requested data array element from the first
(default) bank as a float .
return (float)data[i+offset];
| public float | getElemFloat(int bank, int i)Returns the requested data array element from the specified
bank as a float .
return (float)bankdata[bank][i+offsets[bank]];
| public void | setElem(int i, int val)Sets the requested data array element in the first (default)
bank to the given int .
data[i+offset] = (double)val;
| public void | setElem(int bank, int i, int val)Sets the requested data array element in the specified bank
to the given int .
bankdata[bank][i+offsets[bank]] = (double)val;
| public void | setElemDouble(int i, double val)Sets the requested data array element in the first (default)
bank to the given double .
data[i+offset] = val;
| public void | setElemDouble(int bank, int i, double val)Sets the requested data array element in the specified bank to
the given double .
bankdata[bank][i+offsets[bank]] = val;
| public void | setElemFloat(int i, float val)Sets the requested data array element in the first (default)
bank to the given float .
data[i+offset] = (double)val;
| public void | setElemFloat(int bank, int i, float val)Sets the requested data array element in the specified bank to
the given float .
bankdata[bank][i+offsets[bank]] = (double)val;
|
|