Class LandFillObjectPool<O>

  • All Implemented Interfaces:
    ObjectPool<O>

    public class LandFillObjectPool<O>
    extends java.lang.Object
    A dummy implementation which simply allocates a new object on every ObjectPool.get() and lets the garbage collector dispose of it rather than reusing.
    • Constructor Summary

      Constructors 
      Constructor Description
      LandFillObjectPool​(java.util.function.Supplier<O> objectSupplier)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose​(O object)
      Return an object to the pool, indicating that it will no longer be used and can be recycled.
      O get()  
      • Methods inherited from class java.lang.Object

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

      • LandFillObjectPool

        public LandFillObjectPool​(java.util.function.Supplier<O> objectSupplier)
    • Method Detail

      • dispose

        public void dispose​(O object)
        Description copied from interface: ObjectPool
        Return an object to the pool, indicating that it will no longer be used and can be recycled.
        Parameters:
        object - which is no longer used.
      • get

        public O get()
        Specified by:
        get in interface ObjectPool<O>
        Returns:
        an object, potentially from the pool, or potentially instantiating a new one if necessary.