public class ConcurrentPools
extends java.lang.Object
Pool
s (usually ConcurrentReflectionPool
s) by type for convenient static access.Modifier and Type | Method and Description |
---|---|
static void |
free(java.lang.Object object)
Frees an object from the
pool . |
static void |
freeAll(org.mini2Dx.gdx.utils.Array objects)
Frees the specified objects from the
pool . |
static void |
freeAll(org.mini2Dx.gdx.utils.Array objects,
boolean samePool)
Frees the specified objects from the
pool . |
static <T> org.mini2Dx.gdx.utils.Pool<T> |
get(java.lang.Class<T> type)
Returns a new or existing pool for the specified type, stored in a Class to
Pool map. |
static <T> org.mini2Dx.gdx.utils.Pool<T> |
get(java.lang.Class<T> type,
int max)
Returns a new or existing pool for the specified type, stored in a Class to
Pool map. |
static <T> T |
obtain(java.lang.Class<T> type)
Obtains an object from the
pool . |
static <T> void |
set(java.lang.Class<T> type,
org.mini2Dx.gdx.utils.Pool<T> pool)
Sets an existing pool for the specified type, stored in a Class to
Pool map. |
public static <T> org.mini2Dx.gdx.utils.Pool<T> get(java.lang.Class<T> type, int max)
Pool
map. Note the max size is ignored
if this is not the first time this pool has been requested.public static <T> org.mini2Dx.gdx.utils.Pool<T> get(java.lang.Class<T> type)
Pool
map. The max size of the pool used
is 100.public static <T> void set(java.lang.Class<T> type, org.mini2Dx.gdx.utils.Pool<T> pool)
Pool
map.public static <T> T obtain(java.lang.Class<T> type)
pool
.public static void free(java.lang.Object object)
pool
.public static void freeAll(org.mini2Dx.gdx.utils.Array objects)
pool
. Null objects within the array are silently ignored. Objects
don't need to be from the same pool.public static void freeAll(org.mini2Dx.gdx.utils.Array objects, boolean samePool)
pool
. Null objects within the array are silently ignored.samePool
- If true, objects don't need to be from the same pool but the pool must be looked up for each object.