NASA World Wind

gov.nasa.worldwind.util
Class BufferFactory.ShortBufferFactory

java.lang.Object
  extended by gov.nasa.worldwind.util.BufferFactory
      extended by gov.nasa.worldwind.util.BufferFactory.ShortBufferFactory
Enclosing class:
BufferFactory

public static class BufferFactory.ShortBufferFactory
extends BufferFactory

Implementation of BufferFactory which constructs instances of BufferWrapper.ShortBufferWrapper


Nested Class Summary
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.util.BufferFactory
BufferFactory.ByteBufferFactory, BufferFactory.DoubleBufferFactory, BufferFactory.FloatBufferFactory, BufferFactory.IntBufferFactory, BufferFactory.ShortBufferFactory
 
Constructor Summary
BufferFactory.ShortBufferFactory()
          Constructs a new ShortBufferFactory with the default buffer allocation policy.
BufferFactory.ShortBufferFactory(boolean allocateDirect)
          Constructs a new ShortBufferFactory with the specified buffer allocation policy.
 
Method Summary
 BufferWrapper newBuffer(int size)
          Constructs a new ShortBufferWrapper of the specified size, backed by a ShortBuffer.
 
Methods inherited from class gov.nasa.worldwind.util.BufferFactory
isAllocateDirect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferFactory.ShortBufferFactory

public BufferFactory.ShortBufferFactory()
Constructs a new ShortBufferFactory with the default buffer allocation policy. This factory allocates and returns ShortBufferWrappers backed by direct buffers.


BufferFactory.ShortBufferFactory

public BufferFactory.ShortBufferFactory(boolean allocateDirect)
Constructs a new ShortBufferFactory with the specified buffer allocation policy.

Parameters:
allocateDirect - true to allocate and return ShortBufferWrappers backed by direct buffers, false to allocate and return ShortBufferWrappers backed by non-direct buffers.
Method Detail

newBuffer

public BufferWrapper newBuffer(int size)
Constructs a new ShortBufferWrapper of the specified size, backed by a ShortBuffer.

Specified by:
newBuffer in class BufferFactory
Parameters:
size - the new buffer's size, int shorts.
Returns:
the new buffer.
Throws:
IllegalArgumentException - if size is negative.

NASA World Wind