public final class DataBufferUShort extends DataBuffer
DataBuffer that uses an array of short primitives
to represent each of its banks.banks, dataType, offset, offsets, size, TYPE_BYTE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_SHORT, TYPE_UNDEFINED, TYPE_USHORT| Constructor and Description |
|---|
DataBufferUShort(int size)
Creates a new data buffer with a single data bank containing the
specified number of
short elements. |
DataBufferUShort(int size,
int numBanks)
Creates a new data buffer with the specified number of data banks,
each containing the specified number of
short elements. |
DataBufferUShort(short[][] dataArray,
int size)
Creates a new data buffer backed by the specified data banks.
|
DataBufferUShort(short[][] dataArray,
int size,
int[] offsets)
Creates a new data buffer backed by the specified data banks, with
the specified offsets to the first element in each bank.
|
DataBufferUShort(short[] dataArray,
int size)
Creates a new data buffer backed by the specified data bank.
|
DataBufferUShort(short[] dataArray,
int size,
int offset)
Creates a new data buffer backed by the specified data bank, with
the specified offset to the first element.
|
| Modifier and Type | Method and Description |
|---|---|
short[][] |
getBankData()
Returns the array underlying this
DataBuffer. |
short[] |
getData()
Returns the first data bank.
|
short[] |
getData(int bank)
Returns a data bank.
|
int |
getElem(int i)
Returns an element from the first data bank.
|
int |
getElem(int bank,
int i)
Returns an element from a particular data bank.
|
void |
setElem(int i,
int val)
Sets an element in the first data bank.
|
void |
setElem(int bank,
int i,
int val)
Sets an element in a particular data bank.
|
getDataType, getDataTypeSize, getElemDouble, getElemDouble, getElemFloat, getElemFloat, getNumBanks, getOffset, getOffsets, getSize, setElemDouble, setElemDouble, setElemFloat, setElemFloatpublic DataBufferUShort(int size)
short elements.size - the number of elements in the data bank.public DataBufferUShort(int size, int numBanks)
short elements.size - the number of elements in the data bank.numBanks - the number of data banks.public DataBufferUShort(short[] dataArray, int size)
dataArray - the data bank.size - the number of elements in the data bank.NullPointerException - if dataArray is nullpublic DataBufferUShort(short[] dataArray, int size, int offset)
dataArray - the data bank.size - the number of elements in the data bank.offset - the offset to the first element in the array.NullPointerException - if dataArray is nullpublic DataBufferUShort(short[][] dataArray, int size)
dataArray - the data banks.size - the number of elements in the data bank.NullPointerException - if dataArray is
null.public DataBufferUShort(short[][] dataArray, int size, int[] offsets)
dataArray - the data banks.size - the number of elements in the data bank.offsets - the offsets to the first element in each data bank.NullPointerException - if dataArray is
null.public short[] getData()
public short[] getData(int bank)
bank - the bank index.public short[][] getBankData()
DataBuffer.public int getElem(int i)
i before accessing the
underlying data array.getElem in class DataBufferi - the element index.public int getElem(int bank, int i)
i before accessing the
underlying data array.getElem in class DataBufferbank - the bank index.i - the element index.public void setElem(int i, int val)
i before updating the underlying
data array.setElem in class DataBufferi - the element index.val - the new element value.public void setElem(int bank, int i, int val)
i before updating the underlying
data array.setElem in class DataBufferbank - the data bank index.i - the element index.val - the new element value.