java.io.Closeable
, java.lang.AutoCloseable
, Releasable
, Recycler<T>
ConcurrentDequeRecycler
public class DequeRecycler<T>
extends java.lang.Object
Recycler
implementation based on a Deque
. This implementation is NOT thread-safe.Recycler.C<T>, Recycler.Factory<T>, Recycler.V<T>
Modifier and Type | Field | Description |
---|---|---|
protected Recycler.C<T> |
c |
Constructor | Description |
---|---|
DequeRecycler(Recycler.C<T> c,
java.util.Deque<T> queue,
int maxSize) |
Modifier and Type | Method | Description |
---|---|---|
protected void |
afterRelease(boolean recycled) |
Called after a release.
|
protected boolean |
beforeRelease() |
Called before releasing an object, returns true if the object should be recycled and false otherwise.
|
void |
close() |
|
Recycler.V<T> |
obtain() |
|
Recycler.V<T> |
obtain(int sizing) |
protected final Recycler.C<T> c
public DequeRecycler(Recycler.C<T> c, java.util.Deque<T> queue, int maxSize)
public void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
close
in interface Recycler<T>
close
in interface Releasable
public Recycler.V<T> obtain(int sizing)
protected boolean beforeRelease()
protected void afterRelease(boolean recycled)
public Recycler.V<T> obtain()