|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.BufferWrapper
public abstract class BufferWrapper
BufferWrapper provides an interface for reading and writing primitive data to and from data buffers, without having to know the underlying data type. BufferWrapper may be backed by a primitive data buffer of any type.
| Nested Class Summary | |
|---|---|
static class |
BufferWrapper.AbstractBufferWrapper
|
static class |
BufferWrapper.ByteBufferWrapper
|
static class |
BufferWrapper.DoubleBufferWrapper
|
static class |
BufferWrapper.FloatBufferWrapper
|
static class |
BufferWrapper.IntBufferWrapper
|
static class |
BufferWrapper.ShortBufferWrapper
|
| Constructor Summary | |
|---|---|
BufferWrapper()
|
|
| Method Summary | |
|---|---|
abstract java.nio.Buffer |
getBackingBuffer()
Returns the buffer's backing data sture. |
abstract byte |
getByte(int index)
Returns the value at the specified index, cast to a byte. |
abstract void |
getByte(int index,
byte[] array,
int offset,
int length)
Returns the sequence of values starting at the specified index and with the specified length, cast to bytes. |
abstract double |
getDouble(int index)
Returns the value at the specified index, cast to a double. |
abstract void |
getDouble(int index,
double[] array,
int offset,
int length)
Returns the sequence of values starting at the specified index and with the specified length, cast to doubles. |
abstract float |
getFloat(int index)
Returns the value at the specified index, cast to a float. |
abstract void |
getFloat(int index,
float[] array,
int offset,
int length)
Returns the sequence of values starting at the specified index and with the specified length, cast to floats. |
abstract int |
getGLDataType()
Returns the OpenGL data type corresponding to the buffer's underlying data type (e.g. |
abstract int |
getInt(int index)
Returns the value at the specified index, cast to an int. |
abstract void |
getInt(int index,
int[] array,
int offset,
int length)
Returns the sequence of values starting at the specified index and with the specified length, cast to ints. |
abstract short |
getShort(int index)
Returns the value at the specified index, cast to a short. |
abstract void |
getShort(int index,
short[] array,
int offset,
int length)
Returns the sequence of values starting at the specified index and with the specified length, cast to shorts. |
abstract long |
getSizeInBytes()
Returns the size of this buffer, in bytes. |
abstract BufferWrapper |
getSubBuffer(int index,
int length)
Returns a new BufferWrapper which is a subsequence of this buffer. |
abstract int |
length()
Returns the length of the buffer, in units of the underlying data type (e.g. bytes, shorts, ints, floats, doubles). |
abstract void |
putByte(int index,
byte value)
Sets the value at the specified index as a byte. |
abstract void |
putByte(int index,
byte[] array,
int offset,
int length)
Sets the sequence of values starting at the specified index and with the specified length, as bytes. |
abstract void |
putDouble(int index,
double value)
Sets the value at the specified index as a double. |
abstract void |
putDouble(int index,
double[] array,
int offset,
int length)
Sets the sequence of values starting at the specified index and with the specified length, as doubles. |
abstract void |
putFloat(int index,
float value)
Sets the value at the specified index as a float. |
abstract void |
putFloat(int index,
float[] array,
int offset,
int length)
Sets the sequence of values starting at the specified index and with the specified length, as floats. |
abstract void |
putInt(int index,
int value)
Sets the value at the specified index as an int. |
abstract void |
putInt(int index,
int[] array,
int offset,
int length)
Sets the sequence of values starting at the specified index and with the specified length, as ints. |
abstract void |
putShort(int index,
short value)
Sets the value at the specified index as a short. |
abstract void |
putShort(int index,
short[] array,
int offset,
int length)
Sets the sequence of values starting at the specified index and with the specified length, as ints. |
abstract void |
putSubBuffer(int index,
BufferWrapper buffer)
Sets a subsequence of this buffer with the contents of the specified buffer. |
protected static java.lang.String |
validate(AVList params)
|
protected static boolean |
validateByteOrder(java.lang.Object o)
|
protected static boolean |
validateDataType(java.lang.Object o)
|
static BufferWrapper |
wrap(java.nio.ByteBuffer byteBuffer,
AVList parameters)
Wraps the specified ByteBuffer with a BufferWrapper according to the specified parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferWrapper()
| Method Detail |
|---|
public abstract java.nio.Buffer getBackingBuffer()
Buffer.
public abstract byte getByte(int index)
index - the index of the value to be returned.
public abstract void getByte(int index,
byte[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to get.public abstract double getDouble(int index)
index - the index of the value to be returned.
public abstract void getDouble(int index,
double[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to get.public abstract float getFloat(int index)
index - the index of the value to be returned.
public abstract void getFloat(int index,
float[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to get.public abstract int getGLDataType()
public abstract int getInt(int index)
index - the index of the value to be returned.
public abstract void getInt(int index,
int[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to get.public abstract short getShort(int index)
index - the index of the value to be returned.
public abstract void getShort(int index,
short[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to get.public abstract long getSizeInBytes()
public abstract BufferWrapper getSubBuffer(int index,
int length)
index - the new buffer's starting index.length - the new buffer's length.
public abstract int length()
public abstract void putByte(int index,
byte value)
index - the index of the value to be returned.value - the byte value to be set.
public abstract void putByte(int index,
byte[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to put.
public abstract void putDouble(int index,
double value)
index - the index of the value to be returned.value - the double value to be set.
public abstract void putDouble(int index,
double[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to put.
public abstract void putFloat(int index,
float value)
index - the index of the value to be returned.value - the float value to be set.
public abstract void putFloat(int index,
float[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to put.
public abstract void putInt(int index,
int value)
index - the index of the value to be returned.value - the int value to be set.
public abstract void putInt(int index,
int[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to put.
public abstract void putShort(int index,
short value)
index - the index of the value to be returned.value - the short value to be set.
public abstract void putShort(int index,
short[] array,
int offset,
int length)
index - the buffer starting index.array - the array.offset - the array starting index.length - the number of values to put.
public abstract void putSubBuffer(int index,
BufferWrapper buffer)
index - the starting index to set.buffer - the buffer.protected static java.lang.String validate(AVList params)
protected static boolean validateByteOrder(java.lang.Object o)
protected static boolean validateDataType(java.lang.Object o)
public static BufferWrapper wrap(java.nio.ByteBuffer byteBuffer,
AVList parameters)
ByteBuffer with a BufferWrapper according to the specified parameters. The byteBuffer
is interpreted according to values found in the parameters. AVKey.BYTE_ORDER specifies the byteBuffer's
byte ordering,. and AVKey.DATA_TYPE specifies type of data store in the byteBuffer: shorts, ints, or
floats.
byteBuffer - the buffer to wrap.parameters - the parameters which describe how to interpret the buffer.
java.lang.IllegalArgumentException - if either the byteBuffer or parameters are null, or if the parameters do not
completely describe how to interpret the byteBuffer.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||