Class SoftReferenceBag<T>


  • public class SoftReferenceBag<T>
    extends java.lang.Object
    Acts as a bag (kind of like an un-ordered list or a set of like items) whose entries are kept in SoftReferences. This class is not thread-safe - provide your own locking if multiple threads will access it.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void put​(T obj)  
      T take()
      Returns and removes the next available item from the bag.
      • Methods inherited from class java.lang.Object

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

      • SoftReferenceBag

        public SoftReferenceBag()
    • Method Detail

      • take

        public T take()
        Returns and removes the next available item from the bag. May be null if the bag is empty.
      • put

        public void put​(T obj)