Package arc.util.pooling
Class Pools
java.lang.Object
arc.util.pooling.Pools
Stores a map of
Pool
s by type for convenient static access.-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Frees an object from thepool
.static void
Frees the specified objects from thepool
.static void
Frees the specified objects from thepool
.static <T> Pool<T>
Returns a new or existing pool for the specified type, stored in a Class toPool
map.static <T> Pool<T>
Returns a new or existing pool for the specified type, stored in a Class toPool
map.static <T> T
Obtains an object from thepool
.static <T> void
Sets an existing pool for the specified type, stored in a Class toPool
map.
-
Method Details
-
get
Returns a new or existing pool for the specified type, stored in a Class toPool
map. Note that the max size is ignored for some reason. if this is not the first time this pool has been requested. -
get
Returns a new or existing pool for the specified type, stored in a Class toPool
map. The max size of the pool used is 5000. -
set
Sets an existing pool for the specified type, stored in a Class toPool
map. -
obtain
Obtains an object from thepool
. -
free
Frees an object from thepool
. -
freeAll
Frees the specified objects from thepool
. Null objects within the array are silently ignored. Objects don't need to be from the same pool. -
freeAll
Frees the specified objects from thepool
. Null objects within the array are silently ignored.- Parameters:
samePool
- If true, objects don't need to be from the same pool but the pool must be looked up for each object.
-