Package net.dermetfan.gdx.utils
Class ArrayPools
java.lang.Object
net.dermetfan.gdx.utils.ArrayPools
public class ArrayPools
extends java.lang.Object
stores a map of
ArrayPools (usually ReflectionArrayPool) for convenient static access- Since:
- 0.11.1
-
Method Summary
Modifier and Type Method Description static voidfree(float[] array)static voidfree(int[] array)static <T> voidfree(T[] array)static <T> ArrayPool<T>get(java.lang.Class<T> type)callsget(Class, int, int)with a max size of -1 (no max size) and a maxEach size of 100static <T> ArrayPool<T>get(java.lang.Class<T> type, int max, int maxEach)note the max and maxEach sizes are ignored if this is not the first time this pool has been requestedstatic FloatArrayPoolgetFloats()static FloatArrayPoolgetFloats(int max, int maxEach)static IntArrayPoolgetInts()static IntArrayPoolgetInts(int max, int maxEach)static <T> T[]obtain(java.lang.Class<T> type, int length)static float[]obtainFloats(int length)static int[]obtainInts(int length)static <T> voidset(java.lang.Class<T> type, ArrayPool<T> pool)static voidset(FloatArrayPool pool)static voidset(IntArrayPool pool)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
get
note the max and maxEach sizes are ignored if this is not the first time this pool has been requested- Returns:
- a new
ReflectionArrayPoolor existing pool for the specified type, stored in a Class toArrayPoolmap
-
getFloats
- See Also:
get(Class, int, int)
-
getInts
- See Also:
get(Class, int, int)
-
get
callsget(Class, int, int)with a max size of -1 (no max size) and a maxEach size of 100- See Also:
get(Class, int, int)
-
getFloats
- See Also:
get(Class)
-
getInts
- See Also:
get(Class)
-
set
- Parameters:
type- the type for which to set the pool in a Class toArrayPoolmappool- the pool to set for the given type
-
set
- See Also:
set(Class, ArrayPool)
-
set
- See Also:
set(Class, ArrayPool)
-
obtain
public static <T> T[] obtain(java.lang.Class<T> type, int length)- See Also:
ArrayPool.obtain(int)
-
obtainFloats
public static float[] obtainFloats(int length)- See Also:
FloatArrayPool.obtain(int)
-
obtainInts
public static int[] obtainInts(int length)- See Also:
IntArrayPool.obtain(int)
-
free
public static <T> void free(T[] array)- See Also:
ArrayPool.free(Object[])
-
free
public static void free(float[] array)- See Also:
FloatArrayPool.free(float[])
-
free
public static void free(int[] array)- See Also:
IntArrayPool.free(int[])
-