DataBufferFloatpublic final class DataBufferFloat extends DataBuffer The Class DataBufferFloat is the subclass of DataBuffer for the case where
the underlying data is float. |
Fields Summary |
---|
float[] | dataThe data. |
Constructors Summary |
---|
public DataBufferFloat(float[] dataArrays, int size, int[] offsets)Instantiates a new data buffer of type float.
super(TYPE_FLOAT, size, dataArrays.length, offsets);
data = dataArrays.clone();
| public DataBufferFloat(float[] dataArrays, int size)Instantiates a new data buffer of type float.
super(TYPE_FLOAT, size, dataArrays.length);
data = dataArrays.clone();
| public DataBufferFloat(float[] dataArray, int size, int offset)Instantiates a new data buffer of type float with a single underlying
array of data.
super(TYPE_FLOAT, size, 1, offset);
data = new float[1][];
data[0] = dataArray;
| public DataBufferFloat(float[] dataArray, int size)Instantiates a new data buffer of type float with a single underlying
array of data starting at index 0.
super(TYPE_FLOAT, size);
data = new float[1][];
data[0] = dataArray;
| public DataBufferFloat(int size, int numBanks)Instantiates a new empty data buffer of type float with offsets equal to
zero.
super(TYPE_FLOAT, size, numBanks);
data = new float[numBanks][];
int i = 0;
while (i < numBanks) {
data[i++] = new float[size];
}
| public DataBufferFloat(int size)Instantiates a new empty data buffer of type float with a single
underlying array of data starting at index 0.
super(TYPE_FLOAT, size);
data = new float[1][];
data[0] = new float[size];
|
Methods Summary |
---|
public float[][] | getBankData()Gets the bank data.
notifyTaken();
return data.clone();
| public float[] | getData(int bank)Gets the data of the specified internal data array.
notifyTaken();
return data[bank];
| public float[] | getData()Gets the data of the first data array.
notifyTaken();
return data[0];
| public int | getElem(int bank, int i)
return (int)(data[bank][offsets[bank] + i]);
| public int | getElem(int i)
return (int)(data[0][offset + i]);
| public double | getElemDouble(int bank, int i)
return data[bank][offsets[bank] + i];
| public double | getElemDouble(int i)
return data[0][offset + i];
| public float | getElemFloat(int bank, int i)
return data[bank][offsets[bank] + i];
| public float | getElemFloat(int i)
return data[0][offset + i];
| public void | setElem(int i, int val)
data[0][offset + i] = val;
notifyChanged();
| public void | setElem(int bank, int i, int val)
data[bank][offsets[bank] + i] = val;
notifyChanged();
| public void | setElemDouble(int i, double val)
data[0][offset + i] = (float)val;
notifyChanged();
| public void | setElemDouble(int bank, int i, double val)
data[bank][offsets[bank] + i] = (float)val;
notifyChanged();
| public void | setElemFloat(int i, float val)
data[0][offset + i] = val;
notifyChanged();
| public void | setElemFloat(int bank, int i, float val)
data[bank][offsets[bank] + i] = val;
notifyChanged();
|
|