com.bulletphysics
Class ArrayPool<T>

java.lang.Object
  extended by com.bulletphysics.ArrayPool<T>

public class ArrayPool<T>
extends java.lang.Object

Object pool for arrays.


Constructor Summary
ArrayPool(java.lang.Class componentType)
          Creates object pool.
 
Method Summary
 T getAtLeast(int length)
          Returns array that has same or greater length, or create one if not present in the pool.
 T getFixed(int length)
          Returns array of exactly the same length as demanded, or create one if not present in the pool.
 void release(T array)
          Releases array into object pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayPool

public ArrayPool(java.lang.Class componentType)
Creates object pool.

Parameters:
componentType -
Method Detail

getFixed

public T getFixed(int length)
Returns array of exactly the same length as demanded, or create one if not present in the pool.

Parameters:
length -
Returns:
array

getAtLeast

public T getAtLeast(int length)
Returns array that has same or greater length, or create one if not present in the pool.

Parameters:
length - the minimum length required
Returns:
array

release

public void release(T array)
Releases array into object pool.

Parameters:
array - previously obtained array from this pool