APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.utils

public abstract Class FlushablePool<T>

extends Pool<T>
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.graphics.g3d.ModelBatch.RenderablePool, com.badlogic.gdx.graphics.g3d.utils.shapebuilders.RenderableShapeBuilder.RenderablePool

A Pool which keeps track of the obtained items (see obtain()), which can be free'd all at once using the flush() method.
Author
Xoppa

Field Summary

Modifier and TypeField and Description
protected Array<T>
Inherited from com.badlogic.gdx.utils.Pool:
maxpeak

Constructor Summary

AccessConstructor and Description
public
public
FlushablePool(int initialCapacity)

public
FlushablePool(int initialCapacity, int max)

Method Summary

Modifier and TypeMethod and Description
public void
flush()

Frees all obtained instances.

public void
free(T object)

Overrides com.badlogic.gdx.utils.Pool.free.

Puts the specified object in the pool, making it eligible to be returned by obtain().

public void
freeAll(Array<T> objects)

Overrides com.badlogic.gdx.utils.Pool.freeAll.

Puts the specified objects in the pool.

public T
obtain()

Overrides com.badlogic.gdx.utils.Pool.obtain.

Returns an object from this pool.

Inherited from com.badlogic.gdx.utils.Pool:
cleardiscardfillgetFreenewObjectreset

Field Detail

obtainedback to summary
protected Array<T> obtained

Constructor Detail

FlushablePoolback to summary
public FlushablePool()
FlushablePoolback to summary
public FlushablePool(int initialCapacity)
FlushablePoolback to summary
public FlushablePool(int initialCapacity, int max)

Method Detail

flushback to summary
public void flush()

Frees all obtained instances.

freeback to summary
public void free(T object)

Overrides com.badlogic.gdx.utils.Pool.free.

Doc from com.badlogic.gdx.utils.Pool.free.

Puts the specified object in the pool, making it eligible to be returned by obtain(). If the pool already contains max free objects, the specified object is discarded, 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.

Annotations
@Override
freeAllback to summary
public void freeAll(Array<T> objects)

Overrides com.badlogic.gdx.utils.Pool.freeAll.

Doc from com.badlogic.gdx.utils.Pool.freeAll.

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.

Annotations
@Override
obtainback to summary
public T obtain()

Overrides com.badlogic.gdx.utils.Pool.obtain.

Doc from com.badlogic.gdx.utils.Pool.obtain.

Returns an object from this pool. The object may be new (from newObject()) or reused (previously freed).

Annotations
@Override