public final class Pools extends Object
Pools (usually ReflectionPools) by type for convenient static access.| Modifier and Type | Method and Description |
|---|---|
static void |
free(Object object)
Frees an object from the
pool. |
static void |
freeAll(Array objects)
Frees the specified objects from the
pool. |
static void |
freeAll(Array objects,
boolean samePool)
Frees the specified objects from the
pool. |
static void |
freeAll(Object... objects)
Frees all given objects.
|
static <T> Pool<T> |
get(Class<T> type)
The max size of the pool used is 100.
|
static <T> Pool<T> |
get(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(Class<T> type) |
static <T> void |
set(Class<T> type,
Pool<T> pool)
Sets an existing pool for the specified type, stored in a Class to
Pool map. |
public static <T> Pool<T> get(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> Pool<T> get(Class<T> type)
T - pool typetype - pool classPool mappublic static <T> void set(Class<T> type, Pool<T> pool)
Pool map.T - pool typetype - pool classpool - pool objectpublic static <T> T obtain(Class<T> type)
T - object typetype - object classpoolpublic static void free(Object object)
pool.object - the object to freepublic static void freeAll(Array objects)
pool.
Null objects within the array are silently ignored.
Objects don't need to be from the same pool.objects - objects to be freedpublic static void freeAll(Array objects, boolean samePool)
pool.
Null objects within the array are silently ignored.objects - objects to freesamePool - if false, objects don't need to be from the same pool but the pool must be looked up for each objectpublic static void freeAll(Object... objects)
objects - to freeCopyright © 2017. All rights reserved.