Class LRU<K,​V>

  • Type Parameters:
    K - Key type
    V - Value type

    public abstract class LRU<K,​V>
    extends Object
    An abstract LRU interface wrapping an actual LRU implementation.
    • Constructor Detail

      • LRU

        public LRU()
    • Method Detail

      • getIfPresent

        public abstract V getIfPresent​(Object key)
        Returns the value associated with key in this cache, or null if there is no cached value for key.
      • put

        public abstract void put​(K key,
                                 V value)
        Associates value with key in this cache. If the cache previously contained a value associated with key, the old value is replaced by value.
      • create

        public static <K,​V> LRU<K,​V> create()
        Create new LRU
        Returns:
        new LRU