Class DequeRecycler<T>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Releasable, Recycler<T>
    Direct Known Subclasses:
    ConcurrentDequeRecycler

    public class DequeRecycler<T>
    extends java.lang.Object
    A Recycler implementation based on a Deque. This implementation is NOT thread-safe.
    • Constructor Detail

      • DequeRecycler

        public DequeRecycler​(Recycler.C<T> c,
                             java.util.Deque<T> queue,
                             int maxSize)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface Recycler<T>
        Specified by:
        close in interface Releasable
      • beforeRelease

        protected boolean beforeRelease()
        Called before releasing an object, returns true if the object should be recycled and false otherwise.
      • afterRelease

        protected void afterRelease​(boolean recycled)
        Called after a release.