Pools.SynchronizedPool
public class Pools.SynchronizedPool<T extends Object> extends Pools.SimplePool
Synchronized pool of objects.
| Parameters | |
|---|---|
<T extends Object> |
The pooled type. |
Summary
Public constructors |
|---|
<T extends Object> SynchronizedPool(int maxPoolSize) |
Public constructors
SynchronizedPool
public <T extends Object> SynchronizedPool(int maxPoolSize)
| Parameters | |
|---|---|
<T extends Object> |
The pooled type. |
int maxPoolSize |
The maximum pool size |
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. |