Class ThreadCache.ObjectCacheElement

  • Enclosing class:
    ThreadCache

    public static final class ThreadCache.ObjectCacheElement
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectCacheElement​(int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get()
      Get (peek) the object from cache.
      boolean put​(java.lang.Object o)  
      java.lang.Object take()
      Take (poll) the object from cache.
      • Methods inherited from class java.lang.Object

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

      • ObjectCacheElement

        public ObjectCacheElement​(int size)
    • Method Detail

      • put

        public boolean put​(java.lang.Object o)
      • get

        public java.lang.Object get()
        Get (peek) the object from cache. Unlike take() the object will not be removed from cache.
        Returns:
        object from cache.
      • take

        public java.lang.Object take()
        Take (poll) the object from cache. Unlike get() the object will be removed from cache.
        Returns:
        object from cache.