Class BasicPool<T>

  • All Implemented Interfaces:
    Pool<T>
    Direct Known Subclasses:
    SynchronizedPool

    public class BasicPool<T>
    extends java.lang.Object
    implements Pool<T>
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicPool()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T acquire()
      Acquires an instance from the pool.
      void release​(T instance)
      Releases an instance to the pool.
      • Methods inherited from class java.lang.Object

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

      • BasicPool

        public BasicPool()
    • Method Detail

      • acquire

        public T acquire()
        Description copied from interface: Pool
        Acquires an instance from the pool. This returns null if the pool is empty.
        Specified by:
        acquire in interface Pool<T>
        Returns:
        an instance from the pool, or null if the pool is empty
      • release

        public void release​(T instance)
        Description copied from interface: Pool
        Releases an instance to the pool. This has no effect if the instance is null.
        Specified by:
        release in interface Pool<T>
        Parameters:
        instance - the instance to release