NASA World Wind

gov.nasa.worldwind.util
Class TupleBufferFactory

java.lang.Object
  extended by gov.nasa.worldwind.util.TupleBufferFactory
Direct Known Subclasses:
TupleBufferFactory.BasicTupleBufferFactory

public abstract class TupleBufferFactory
extends java.lang.Object

TupleBufferFactory provides a general factory interface for creating instances of VecBuffer, without having to know the underlying data type or the number of coordinates per tuple. Once created, a VecBuffer abstracts reading and writing tuples of primitive values from the underlying data type and tuple size. When VecBuffer is combined with TupleBufferFactory, a component may create and work with tuple data in a type agnostic manner.

TupleBufferFactory is itself abstract and defines the factory interface. It defines several implementations as static inner classes, which serve the most common data types: TupleBufferFactory.ByteTupleBufferFactory, TupleBufferFactory.ShortTupleBufferFactory, TupleBufferFactory.IntTupleBufferFactory, TupleBufferFactory.FloatTupleBufferFactory, and TupleBufferFactory.DoubleTupleBufferFactory.

See Also:
VecBuffer, BufferFactory

Nested Class Summary
static class TupleBufferFactory.BasicTupleBufferFactory
          Implementation of TupleBufferFactory which constructs instances of VecBuffer according to a specified tuple size and BufferFactory.
static class TupleBufferFactory.ByteTupleBufferFactory
          Implementation of TupleBufferFactory which constructs instances of VecBuffer, backed by a BufferWrapper.ByteBufferWrapper.
static class TupleBufferFactory.DoubleTupleBufferFactory
          Implementation of TupleBufferFactory which constructs instances of VecBuffer, backed by a BufferWrapper.DoubleBufferWrapper.
static class TupleBufferFactory.FloatTupleBufferFactory
          Implementation of TupleBufferFactory which constructs instances of VecBuffer, backed by a BufferWrapper.FloatBufferWrapper.
static class TupleBufferFactory.IntTupleBufferFactory
          Implementation of TupleBufferFactory which constructs instances of VecBuffer, backed by a BufferWrapper.IntBufferWrapper.
static class TupleBufferFactory.ShortTupleBufferFactory
          Implementation of TupleBufferFactory which constructs instances of VecBuffer, backed by a BufferWrapper.ShortBufferWrapper.
 
Constructor Summary
TupleBufferFactory()
           
 
Method Summary
abstract  VecBuffer newBuffer(int size)
          Constructs a new VecBuffer with the specified size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleBufferFactory

public TupleBufferFactory()
Method Detail

newBuffer

public abstract VecBuffer newBuffer(int size)
Constructs a new VecBuffer with the specified size.

Parameters:
size - the new buffer's size, in number of tuples.
Returns:
the new buffer.
Throws:
java.lang.IllegalArgumentException - if size is negative.

NASA World Wind