Class PoolBase<T>

  • All Implemented Interfaces:
    Pool<T>

    public class PoolBase<T>
    extends java.lang.Object
    implements Pool<T>
    A Pool of objects. Base implements a non-blocking pool (returns null on no entry) with infinite upper bound. Set effective size by creating the right number of entries when created.
    • Constructor Summary

      Constructors 
      Constructor Description
      PoolBase()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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

      • PoolBase

        public PoolBase()
    • Method Detail

      • put

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

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

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