Most visited

Recently visited

Pools.SimplePool

public static class Pools.SimplePool
extends Object implements Pool<T>

java.lang.Object
   ↳ android.support.v4.util.Pools.SimplePool<T>
Known Direct Subclasses


Simple (non-synchronized) pool of objects.

Summary

Public constructors

Pools.SimplePool(int maxPoolSize)

Creates a new instance.

Public methods

T acquire()
boolean release(T instance)

Release an instance to the pool.

Inherited methods

From class java.lang.Object
From interface android.support.v4.util.Pools.Pool

Public constructors

Pools.SimplePool

Pools.SimplePool (int maxPoolSize)

Creates a new instance.

Parameters
maxPoolSize int: The max pool size.
Throws
IllegalArgumentException If the max pool size is less than zero.

Public methods

acquire

T acquire ()

Returns
T

release

boolean release (T instance)

Release an instance to the pool.

Parameters
instance T: The instance to release.
Returns
boolean Whether the instance was put in the pool.

Hooray!