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 void
free(float[] array)
static void
free(int[] array)
static <T> void
free(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 FloatArrayPool
getFloats()
static FloatArrayPool
getFloats(int max, int maxEach)
static IntArrayPool
getInts()
static IntArrayPool
getInts(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> void
set(java.lang.Class<T> type, ArrayPool<T> pool)
static void
set(FloatArrayPool pool)
static void
set(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
ReflectionArrayPool
or existing pool for the specified type, stored in a Class toArrayPool
map
-
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 toArrayPool
mappool
- 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[])
-