Class LRUCache<K,V>

java.lang.Object
com.mapr.baseutils.utils.LRUCache<K,V>

public class LRUCache<K,V> extends Object
Simple LRU implementation to hold fixed number of entries in cache Least recently used entries are removed as capacity is reached
  • Constructor Details

    • LRUCache

      public LRUCache(long maxSize)
  • Method Details

    • get

      public V get(K key)
    • put

      public void put(K key, V value)
    • remove

      public V remove(K key)
    • clear

      public void clear()
    • usedEntries

      public int usedEntries()
    • size

      public int size()
    • getAllValues

      public Collection<V> getAllValues()
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()