Pool
interface Pool<T : Any!>
Known Indirect Subclasses
|
Interface for managing a pool of objects.
Summary
Public methods |
abstract T? |
|
abstract Boolean |
Release an instance to the pool.
|
Public methods
acquire
@Nullable abstract fun acquire(): T?
Return |
T? |
An instance from the pool if such, null otherwise. |
release
abstract fun release(@NonNull 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. |