public abstract class FlushablePool<T> extends Pool<T>
Pool which keeps track of the obtained items (see obtain()), which can be free'd all at once using the
flush() method.Pool.Poolable| Constructor and Description |
|---|
FlushablePool() |
FlushablePool(int initialCapacity) |
FlushablePool(int initialCapacity,
int max) |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Frees all obtained instances.
|
void |
free(T object)
Puts the specified object in the pool, making it eligible to be returned by
Pool.obtain(). |
void |
freeAll(Array<T> objects)
Puts the specified objects in the pool.
|
T |
obtain()
Returns an object from this pool.
|
public FlushablePool()
public FlushablePool(int initialCapacity)
public FlushablePool(int initialCapacity,
int max)
public T obtain()
PoolPool.newObject()) or reused (previously
freed).public void flush()
public void free(T object)
PoolPool.obtain(). If the pool already contains
Pool.max free objects, the specified object is reset but not added to the pool.