Modifier and Type | Field and Description |
---|---|
private java.lang.ref.WeakReference<java.util.concurrent.ConcurrentLinkedQueue<T>> |
queue |
Constructor and Description |
---|
Impl() |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
create()
Creates a new instance of object.
|
private java.util.concurrent.ConcurrentLinkedQueue<T> |
getQueue() |
void |
recycle(T t)
Returns an object back to the pool.
|
T |
take()
Gets a new object from the pool.
|
private volatile java.lang.ref.WeakReference<java.util.concurrent.ConcurrentLinkedQueue<T>> queue
@NotNull public final T take()
If no object is available in the pool, this method creates a new one.
public final void recycle(T t)
private java.util.concurrent.ConcurrentLinkedQueue<T> getQueue()