Pools.SimplePool
public class Pools.SimplePool<T extends Object> implements Pools.Pool
Pools.SynchronizedPool |
Synchronized pool of objects. |
Simple (non-synchronized) pool of objects.
| Parameters | |
|---|---|
<T extends Object> |
The pooled type. |
Summary
Public constructors |
|---|
<T extends Object> SimplePool(@IntRange(from = 1) int maxPoolSize) |
Public constructors
Public methods
release
public boolean release(@NonNull T instance)
Release an instance to the pool.
| Parameters | |
|---|---|
@NonNull T instance |
The instance to release. |
| Returns | |
|---|---|
boolean |
Whether the instance was put in the pool. |
| Throws | |
|---|---|
kotlin.IllegalStateException |
If the instance is already in the pool. |