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 and Description |
---|---|
protected Recycler.C<T> |
c |
Constructor and Description |
---|
DequeRecycler(Recycler.C<T> c,
java.util.Deque<T> queue,
int maxSize) |
Modifier and Type | Method and 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.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface Releasable
close
in interface Recycler<T>
public Recycler.V<T> obtain(int sizing)
protected boolean beforeRelease()
protected void afterRelease(boolean recycled)
public Recycler.V<T> obtain()