ObjectPool<T extends Poolable> class

Constructors

ObjectPool(int withCapacity, T object)

Properties

desiredCapacity int
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
modelObject ↔ T
read / write
objects List<Object>
read / write
objectsPointer int
read / write
poolId int
read / write
replenishPercentage double
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

get() → T
Returns an instance of Poolable. If get() is called with an empty pool, the pool will be replenished. If the pool capacity is sufficiently large, this could come at a performance cost. [...]
getPoolCapacity() int
Returns the capacity of this object pool. Note : The pool will automatically resize to contain additional objects if the user tries to add more objects than the pool's capacity allows, but this comes at a performance cost. [...]
getPoolCount() int
Returns the number of objects remaining in the pool, for diagnostic purposes. [...]
getPoolId() int
Returns the id of the given pool instance. [...]
getReplenishPercentage() double
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
recycle1(T object) → void
Recycle an instance of Poolable that this pool is capable of generating. The T instance passed must not already exist inside this or any other ObjectPool instance. [...]
recycle2(List<T> objects) → void
Recycle a List of Poolables that this pool is capable of generating. The T instances passed must not already exist inside this or any other ObjectPool instance. [...]
refillPool1() → void
refillPool2(double percentage) → void
resizePool() → void
setReplenishPercentage(double percentage) → void
Set the percentage of the pool to replenish on empty. Valid values are between 0.00f and 1.00f [...]
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

ids int
read / write

Static Methods

create(int withCapacity, Poolable object) ObjectPool<Poolable>
Returns an ObjectPool instance, of a given starting capacity, that recycles instances of a given Poolable object. [...]