Whole document tree
java.awt.image
|
Field Summary | |
protected int |
banks
The number of banks in this DataBuffer. |
protected int |
dataType
The data type of this DataBuffer. |
protected int |
offset
Offset into default (first) bank from which to get the first element. |
protected int[] |
offsets
Offsets into all banks. |
protected int |
size
Usable size of all banks. |
static int |
TYPE_BYTE
Tag for unsigned byte data. |
static int |
TYPE_DOUBLE
Tag for double data. |
static int |
TYPE_FLOAT
Tag for float data. |
static int |
TYPE_INT
Tag for int data. |
static int |
TYPE_SHORT
Tag for signed short data. |
static int |
TYPE_UNDEFINED
Tag for undefined data |
static int |
TYPE_USHORT
Tag for unsigned short data. |
Constructor Summary | |
protected |
DataBuffer(int dataType,
int size)
Constructs a DataBuffer containing one bank of the specified data type and size. |
protected |
DataBuffer(int dataType,
int size,
int numBanks)
Constructs a DataBuffer containing the specified number of banks. |
protected |
DataBuffer(int dataType,
int size,
int numBanks,
int offset)
Constructs a DataBuffer that contains the specified number of banks. |
protected |
DataBuffer(int dataType,
int size,
int numBanks,
int[] offsets)
Constructs a DataBuffer which contains the specified number of banks. |
Method Summary | |
int |
getDataType()
Returns the data type of this DataBuffer. |
static int |
getDataTypeSize(int type)
Returns the size (in bits) of the data type, given a datatype tag. |
int |
getElem(int i)
Returns the requested data array element from the first (default) bank as an integer. |
abstract int |
getElem(int bank,
int i)
Returns the requested data array element from the specified bank as an integer. |
double |
getElemDouble(int i)
Returns the requested data array element from the first (default) bank as a double. |
double |
getElemDouble(int bank,
int i)
Returns the requested data array element from the specified bank as a double. |
float |
getElemFloat(int i)
Returns the requested data array element from the first (default) bank as a float. |
float |
getElemFloat(int bank,
int i)
Returns the requested data array element from the specified bank as a float. |
int |
getNumBanks()
Returns the number of banks in this DataBuffer. |
int |
getOffset()
Returns the offset of the default bank in array elements. |
int[] |
getOffsets()
Returns the offsets (in array elements) of all the banks. |
int |
getSize()
Returns the size (in array elements) of all banks. |
void |
setElem(int i,
int val)
Sets the requested data array element in the first (default) bank from the given integer. |
abstract void |
setElem(int bank,
int i,
int val)
Sets the requested data array element in the specified bank from the given integer. |
void |
setElemDouble(int i,
double val)
Sets the requested data array element in the first (default) bank from the given double. |
void |
setElemDouble(int bank,
int i,
double val)
Sets the requested data array element in the specified bank from the given double. |
void |
setElemFloat(int i,
float val)
Sets the requested data array element in the first (default) bank from the given float. |
void |
setElemFloat(int bank,
int i,
float val)
Sets the requested data array element in the specified bank from the given float. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TYPE_BYTE
public static final int TYPE_USHORT
public static final int TYPE_SHORT
public static final int TYPE_INT
public static final int TYPE_FLOAT
public static final int TYPE_DOUBLE
public static final int TYPE_UNDEFINED
protected int dataType
protected int banks
protected int offset
protected int size
protected int[] offsets
Constructor Detail |
protected DataBuffer(int dataType, int size)
dataType
- the data type of this DataBuffer
size
- the size of the banksprotected DataBuffer(int dataType, int size, int numBanks)
dataType
- the data type of this DataBuffer
size
- the size of the banksnumBanks
- the number of banks in this
DataBuffer
protected DataBuffer(int dataType, int size, int numBanks, int offset)
dataType
- the data type of this DataBuffer
size
- the size of the banksnumBanks
- the number of banks in this
DataBuffer
offset
- the offset for each bankprotected DataBuffer(int dataType, int size, int numBanks, int[] offsets)
dataType
- the data type of this DataBuffer
size
- the size of the banksnumBanks
- the number of banks in this
DataBuffer
offsets
- an array containing an offset for each bank.ArrayIndexOutOfBoundsException
- if numBanks
does not equal the length of offsets
Method Detail |
public static int getDataTypeSize(int type)
type
- the value of one of the defined datatype tagsIllegalArgumentException
- if type
is less than
zero or greater than TYPE_DOUBLE
public int getDataType()
public int getSize()
public int getOffset()
public int[] getOffsets()
public int getNumBanks()
public int getElem(int i)
public abstract int getElem(int bank, int i)
public void setElem(int i, int val)
public abstract void setElem(int bank, int i, int val)
public float getElemFloat(int i)
public float getElemFloat(int bank, int i)
public void setElemFloat(int i, float val)
public void setElemFloat(int bank, int i, float val)
public double getElemDouble(int i)
public double getElemDouble(int bank, int i)
public void setElemDouble(int i, double val)
public void setElemDouble(int bank, int i, double val)
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.