com.bulletphysics
Class ObjectPool<T>

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

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

Object pool.


Constructor Summary
ObjectPool(java.lang.Class<T> cls)
           
 
Method Summary
 T get()
          Returns instance from pool, or create one if pool is empty.
 void release(T obj)
          Release instance into pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectPool

public ObjectPool(java.lang.Class<T> cls)
Method Detail

get

public T get()
Returns instance from pool, or create one if pool is empty.

Returns:
instance

release

public void release(T obj)
Release instance into pool.

Parameters:
obj - previously obtained instance from pool