Package com.badlogic.gdx.utils
Class FlushablePool<T>
java.lang.Object
com.badlogic.gdx.utils.Pool<T>
com.badlogic.gdx.utils.FlushablePool<T>
- Direct Known Subclasses:
ModelBatch.RenderablePool
-
Nested Class Summary
Nested classes/interfaces inherited from class com.badlogic.gdx.utils.Pool
Pool.Poolable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFlushablePool
(int initialCapacity) FlushablePool
(int initialCapacity, int max) -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Frees all obtained instances.void
Puts the specified object in the pool, making it eligible to be returned byPool.obtain()
.void
Puts the specified objects in the pool.obtain()
Returns an object from this pool.
-
Field Details
-
obtained
-
-
Constructor Details
-
FlushablePool
public FlushablePool() -
FlushablePool
public FlushablePool(int initialCapacity) -
FlushablePool
public FlushablePool(int initialCapacity, int max)
-
-
Method Details
-
obtain
Description copied from class:Pool
Returns an object from this pool. The object may be new (fromPool.newObject()
) or reused (previouslyfreed
). -
flush
public void flush()Frees all obtained instances. -
free
Description copied from class:Pool
Puts the specified object in the pool, making it eligible to be returned byPool.obtain()
. If the pool already containsPool.max
free objects, the specified object isdiscarded
, it is not reset and not added to the pool.The pool does not check if an object is already freed, so the same object must not be freed multiple times.
-
freeAll
Description copied from class:Pool
Puts the specified objects in the pool. Null objects within the array are silently ignored.The pool does not check if an object is already freed, so the same object must not be freed multiple times.
-