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
public abstract class FlushablePool<T> extends Pool<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.badlogic.gdx.utils.Pool
Pool.Poolable
-
-
Constructor Summary
Constructors Constructor Description FlushablePool()
FlushablePool(int initialCapacity)
FlushablePool(int initialCapacity, int max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
Frees all obtained instances.void
free(T object)
Puts the specified object in the pool, making it eligible to be returned byPool.obtain()
.void
freeAll(Array<T> objects)
Puts the specified objects in the pool.T
obtain()
Returns an object from this pool.
-
-
-
Method Detail
-
obtain
public T 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
public void free(T object)
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
public void freeAll(Array<T> objects)
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.
- Overrides:
freeAll
in classPool<T>
- See Also:
Pool.free(Object)
-
-