NASA World Wind

gov.nasa.worldwind.util
Class BufferWrapper.ShortBufferWrapper

java.lang.Object
  extended by gov.nasa.worldwind.util.BufferWrapper
      extended by gov.nasa.worldwind.util.BufferWrapper.AbstractBufferWrapper<ShortBuffer>
          extended by gov.nasa.worldwind.util.BufferWrapper.ShortBufferWrapper
Enclosing class:
BufferWrapper

public static class BufferWrapper.ShortBufferWrapper
extends BufferWrapper.AbstractBufferWrapper<ShortBuffer>


Nested Class Summary
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.util.BufferWrapper
BufferWrapper.AbstractBufferWrapper<T extends Buffer>, BufferWrapper.ByteBufferWrapper, BufferWrapper.DoubleBufferWrapper, BufferWrapper.EmptyBufferWrapper, BufferWrapper.FloatBufferWrapper, BufferWrapper.IntBufferWrapper, BufferWrapper.ShortBufferWrapper
 
Field Summary
 
Fields inherited from class gov.nasa.worldwind.util.BufferWrapper.AbstractBufferWrapper
buffer
 
Fields inherited from class gov.nasa.worldwind.util.BufferWrapper
EMPTY_BUFFER_WRAPPER
 
Constructor Summary
BufferWrapper.ShortBufferWrapper(ShortBuffer buffer)
           
 
Method Summary
 BufferWrapper copyOf(int newSize)
          Returns a copy of this buffer with the specified new size.
protected  void doGetByte(byte[] array, int offset, int length)
           
protected  void doGetDouble(double[] array, int offset, int length)
           
protected  void doGetFloat(float[] array, int offset, int length)
           
protected  void doGetInt(int[] array, int offset, int length)
           
protected  void doGetShort(short[] array, int offset, int length)
           
protected  BufferWrapper doGetSubBuffer()
           
protected  void doPutByte(byte[] array, int offset, int length)
           
protected  void doPutDouble(double[] array, int offset, int length)
           
protected  void doPutFloat(float[] array, int offset, int length)
           
protected  void doPutInt(int[] array, int offset, int length)
           
protected  void doPutShort(short[] array, int offset, int length)
           
protected  boolean doPutSubBuffer(int index, BufferWrapper buffer, int offset, int length)
           
 ShortBuffer getBackingShortBuffer()
           
 byte getByte(int index)
          Returns the value at the specified index, cast to a byte.
 double getDouble(int index)
          Returns the value at the specified index, cast to a double.
 float getFloat(int index)
          Returns the value at the specified index, cast to a float.
 int getGLDataType()
          Returns the OpenGL data type corresponding to the buffer's underlying data type (e.g.
 int getInt(int index)
          Returns the value at the specified index, cast to an int.
 short getShort(int index)
          Returns the value at the specified index, cast to a short.
 long getSizeInBytes()
          Returns the size of this buffer, in bytes.
 void putByte(int index, byte value)
          Sets the value at the specified index as a byte.
 void putDouble(int index, double value)
          Sets the value at the specified index as a double.
 void putFloat(int index, float value)
          Sets the value at the specified index as a float.
 void putInt(int index, int value)
          Sets the value at the specified index as an int.
 void putShort(int index, short value)
          Sets the value at the specified index as a short.
 
Methods inherited from class gov.nasa.worldwind.util.BufferWrapper.AbstractBufferWrapper
getBackingBuffer, getByte, getDouble, getFloat, getInt, getShort, getSubBuffer, length, putByte, putDouble, putFloat, putInt, putShort, putSubBuffer, putSubBuffer
 
Methods inherited from class gov.nasa.worldwind.util.BufferWrapper
emptyBufferWrapper, wrap, wrap, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferWrapper.ShortBufferWrapper

public BufferWrapper.ShortBufferWrapper(ShortBuffer buffer)
Method Detail

copyOf

public BufferWrapper copyOf(int newSize)
Description copied from class: BufferWrapper
Returns a copy of this buffer with the specified new size. The new size must be greater than or equal to this buffer's size. If the new size is greater than this buffer's size, this returns a new buffer which is partially filled with the contents of this buffer. The returned buffer has the same backing buffer type, but its contents are independent from this VecBuffer.

Specified by:
copyOf in class BufferWrapper
Parameters:
newSize - the new buffer's size.
Returns:
the new buffer, with the specified size.

doGetByte

protected void doGetByte(byte[] array,
                         int offset,
                         int length)
Specified by:
doGetByte in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doGetDouble

protected void doGetDouble(double[] array,
                           int offset,
                           int length)
Specified by:
doGetDouble in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doGetFloat

protected void doGetFloat(float[] array,
                          int offset,
                          int length)
Specified by:
doGetFloat in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doGetInt

protected void doGetInt(int[] array,
                        int offset,
                        int length)
Specified by:
doGetInt in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doGetShort

protected void doGetShort(short[] array,
                          int offset,
                          int length)
Specified by:
doGetShort in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doGetSubBuffer

protected BufferWrapper doGetSubBuffer()
Specified by:
doGetSubBuffer in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doPutByte

protected void doPutByte(byte[] array,
                         int offset,
                         int length)
Specified by:
doPutByte in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doPutDouble

protected void doPutDouble(double[] array,
                           int offset,
                           int length)
Specified by:
doPutDouble in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doPutFloat

protected void doPutFloat(float[] array,
                          int offset,
                          int length)
Specified by:
doPutFloat in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doPutInt

protected void doPutInt(int[] array,
                        int offset,
                        int length)
Specified by:
doPutInt in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doPutShort

protected void doPutShort(short[] array,
                          int offset,
                          int length)
Specified by:
doPutShort in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

doPutSubBuffer

protected boolean doPutSubBuffer(int index,
                                 BufferWrapper buffer,
                                 int offset,
                                 int length)
Specified by:
doPutSubBuffer in class BufferWrapper.AbstractBufferWrapper<ShortBuffer>

getBackingShortBuffer

public ShortBuffer getBackingShortBuffer()

getByte

public byte getByte(int index)
Description copied from class: BufferWrapper
Returns the value at the specified index, cast to a byte.

Specified by:
getByte in class BufferWrapper
Parameters:
index - the index of the value to be returned.
Returns:
the byte at the specified index.

getDouble

public double getDouble(int index)
Description copied from class: BufferWrapper
Returns the value at the specified index, cast to a double.

Specified by:
getDouble in class BufferWrapper
Parameters:
index - the index of the value to be returned.
Returns:
the double at the specified index.

getFloat

public float getFloat(int index)
Description copied from class: BufferWrapper
Returns the value at the specified index, cast to a float.

Specified by:
getFloat in class BufferWrapper
Parameters:
index - the index of the value to be returned.
Returns:
the float at the specified index.

getGLDataType

public int getGLDataType()
Description copied from class: BufferWrapper
Returns the OpenGL data type corresponding to the buffer's underlying data type (e.g. GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, GL_DOUBLE).

Specified by:
getGLDataType in class BufferWrapper
Returns:
the buffer's OpenGL data type.

getInt

public int getInt(int index)
Description copied from class: BufferWrapper
Returns the value at the specified index, cast to an int.

Specified by:
getInt in class BufferWrapper
Parameters:
index - the index of the value to be returned.
Returns:
the int at the specified index.

getShort

public short getShort(int index)
Description copied from class: BufferWrapper
Returns the value at the specified index, cast to a short.

Specified by:
getShort in class BufferWrapper
Parameters:
index - the index of the value to be returned.
Returns:
the short at the specified index.

getSizeInBytes

public long getSizeInBytes()
Description copied from class: BufferWrapper
Returns the size of this buffer, in bytes.

Specified by:
getSizeInBytes in class BufferWrapper
Returns:
the buffer's size in bytes.

putByte

public void putByte(int index,
                    byte value)
Description copied from class: BufferWrapper
Sets the value at the specified index as a byte. The byte is cast to the underlying data type.

Specified by:
putByte in class BufferWrapper
Parameters:
index - the index of the value to be returned.
value - the byte value to be set.

putDouble

public void putDouble(int index,
                      double value)
Description copied from class: BufferWrapper
Sets the value at the specified index as a double. The double is cast to the underlying data type.

Specified by:
putDouble in class BufferWrapper
Parameters:
index - the index of the value to be returned.
value - the double value to be set.

putFloat

public void putFloat(int index,
                     float value)
Description copied from class: BufferWrapper
Sets the value at the specified index as a float. The float is cast to the underlying data type.

Specified by:
putFloat in class BufferWrapper
Parameters:
index - the index of the value to be returned.
value - the float value to be set.

putInt

public void putInt(int index,
                   int value)
Description copied from class: BufferWrapper
Sets the value at the specified index as an int. The int is cast to the underlying data type.

Specified by:
putInt in class BufferWrapper
Parameters:
index - the index of the value to be returned.
value - the int value to be set.

putShort

public void putShort(int index,
                     short value)
Description copied from class: BufferWrapper
Sets the value at the specified index as a short. The short is cast to the underlying data type.

Specified by:
putShort in class BufferWrapper
Parameters:
index - the index of the value to be returned.
value - the short value to be set.

NASA World Wind