public class Pools extends Object
ReflectionPool
s 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 <T> Pool<T> |
get(Class<T> type)
Returns a new or existing pool for the specified type, stored in a a Class to
ReflectionPool map. |
static <T> Pool<T> |
get(Class<T> type,
int max)
Returns a new or existing pool for the specified type, stored in a a Class to
ReflectionPool map. |
static <T> T |
obtain(Class<T> type)
Obtains an object from the
pool . |
public static <T> Pool<T> get(Class<T> type, int max)
ReflectionPool
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)
ReflectionPool
map. The max size of
the pool used is 100.public static void freeAll(Array objects)
pool
. Null objects within the array are silently ignored. Objects
don't need to be from the same pool.Copyright © 2014. All Rights Reserved.