Pool

interface Pool<T : Any!>
androidx.core.util.Pools.Pool

Interface for managing a pool of objects.

Summary

Public methods
abstract T?

abstract Boolean
release(instance: T)

Release an instance to the pool.

Public methods

acquire

abstract fun acquire(): T?
Return
T?: An instance from the pool if such, null otherwise.

release

abstract fun release(instance: T): Boolean

Release an instance to the pool.

Parameters
instance T: The instance to release.
Return
Boolean: Whether the instance was put in the pool.
Exceptions
IllegalStateException If the instance is already in the pool.