|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bulletphysics.util.ArrayPool<T>
public class ArrayPool<T>
Object pool for arrays.
Constructor Summary | |
---|---|
ArrayPool(Class componentType)
Creates object pool. |
Method Summary | ||
---|---|---|
static void |
cleanCurrentThread()
|
|
static
|
get(Class cls)
Returns per-thread array pool for given type, or create one if it doesn't exist. |
|
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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayPool(Class componentType)
componentType
- Method Detail |
---|
public T getFixed(int length)
length
-
public T getAtLeast(int length)
length
- the minimum length required
public void release(T array)
array
- previously obtained array from this poolpublic static <T> ArrayPool<T> get(Class cls)
cls
- type
public static void cleanCurrentThread()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |