Class PoolSync<T>

  • All Implemented Interfaces:
    Pool<T>

    public class PoolSync<T>
    extends java.lang.Object
    implements Pool<T>
    Synchronization wrapper for a pool
    • Constructor Summary

      Constructors 
      Constructor Description
      PoolSync​(Pool<T> pool)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> Pool<T> create​(Pool<T> pool)  
      T get()
      Get an item from the pool - return null if the pool is empty
      boolean isEmpty()  
      void put​(T item)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PoolSync

        public PoolSync​(Pool<T> pool)
    • Method Detail

      • create

        public static <T> Pool<T> create​(Pool<T> pool)
      • put

        public final void put​(T item)
        Specified by:
        put in interface Pool<T>
      • get

        public final T get()
        Description copied from interface: Pool
        Get an item from the pool - return null if the pool is empty
        Specified by:
        get in interface Pool<T>
      • isEmpty

        public final boolean isEmpty()
        Specified by:
        isEmpty in interface Pool<T>