java.awt.image

Class DataBufferDouble

public final class DataBufferDouble extends DataBuffer

A {@link DataBuffer} that uses an array of double primitives to represent each of its banks.

Since: 1.4

Constructor Summary
DataBufferDouble(int size)
Creates a new data buffer with a single data bank containing the specified number of double elements.
DataBufferDouble(int size, int numBanks)
Creates a new data buffer with the specified number of data banks, each containing the specified number of double elements.
DataBufferDouble(double[] dataArray, int size)
Creates a new data buffer backed by the specified data bank.
DataBufferDouble(double[] dataArray, int size, int offset)
Creates a new data buffer backed by the specified data bank, with the specified offset to the first element.
DataBufferDouble(double[][] dataArray, int size)
Creates a new data buffer backed by the specified data banks.
DataBufferDouble(double[][] 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.
Method Summary
double[][]getBankData()
Returns the array underlying this DataBuffer.
double[]getData()
Returns the first data bank.
double[]getData(int bank)
Returns a data bank.
intgetElem(int i)
Returns an element from the first data bank.
intgetElem(int bank, int i)
Returns an element from a particular data bank.
doublegetElemDouble(int i)
doublegetElemDouble(int bank, int i)
floatgetElemFloat(int i)
floatgetElemFloat(int bank, int i)
voidsetElem(int i, int val)
Sets an element in the first data bank.
voidsetElem(int bank, int i, int val)
Sets an element in a particular data bank.
voidsetElemDouble(int i, double val)
voidsetElemDouble(int bank, int i, double val)
voidsetElemFloat(int i, float val)
voidsetElemFloat(int bank, int i, float val)

Constructor Detail

DataBufferDouble

public DataBufferDouble(int size)
Creates a new data buffer with a single data bank containing the specified number of double elements.

Parameters: size the number of elements in the data bank.

DataBufferDouble

public DataBufferDouble(int size, int numBanks)
Creates a new data buffer with the specified number of data banks, each containing the specified number of double elements.

Parameters: size the number of elements in the data bank. numBanks the number of data banks.

DataBufferDouble

public DataBufferDouble(double[] dataArray, int size)
Creates a new data buffer backed by the specified data bank.

Note: there is no exception when dataArray is null, but in that case an exception will be thrown later if you attempt to access the data buffer.

Parameters: dataArray the data bank. size the number of elements in the data bank.

DataBufferDouble

public DataBufferDouble(double[] dataArray, int size, int offset)
Creates a new data buffer backed by the specified data bank, with the specified offset to the first element.

Note: there is no exception when dataArray is null, but in that case an exception will be thrown later if you attempt to access the data buffer.

Parameters: dataArray the data bank. size the number of elements in the data bank. offset the offset to the first element in the array.

DataBufferDouble

public DataBufferDouble(double[][] dataArray, int size)
Creates a new data buffer backed by the specified data banks.

Parameters: dataArray the data banks. size the number of elements in the data bank.

Throws: NullPointerException if dataArray is null.

DataBufferDouble

public DataBufferDouble(double[][] 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.

Parameters: dataArray the data banks. size the number of elements in the data bank. offsets the offsets to the first element in each data bank.

Throws: NullPointerException if dataArray is null.

Method Detail

getBankData

public double[][] getBankData()
Returns the array underlying this DataBuffer.

Returns: The data banks.

getData

public double[] getData()
Returns the first data bank.

Returns: The first data bank.

getData

public double[] getData(int bank)
Returns a data bank.

Parameters: bank the bank index.

Returns: A data bank.

getElem

public int getElem(int i)
Returns an element from the first data bank. The offset (specified in the constructor) is added to i before accessing the underlying data array.

Parameters: i the element index.

Returns: The element.

getElem

public int getElem(int bank, int i)
Returns an element from a particular data bank. The offset (specified in the constructor) is added to i before accessing the underlying data array.

Parameters: bank the bank index. i the element index.

Returns: The element.

getElemDouble

public double getElemDouble(int i)

getElemDouble

public double getElemDouble(int bank, int i)

getElemFloat

public float getElemFloat(int i)

getElemFloat

public float getElemFloat(int bank, int i)

setElem

public void setElem(int i, int val)
Sets an element in the first data bank. The offset (specified in the constructor) is added to i before updating the underlying data array.

Parameters: i the element index. val the new element value.

setElem

public void setElem(int bank, int i, int val)
Sets an element in a particular data bank. The offset (specified in the constructor) is added to i before updating the underlying data array.

Parameters: bank the data bank index. i the element index. val the new element value.

setElemDouble

public void setElemDouble(int i, double val)

setElemDouble

public void setElemDouble(int bank, int i, double val)

setElemFloat

public void setElemFloat(int i, float val)

setElemFloat

public void setElemFloat(int bank, int i, float val)