Class LRU<K,​V>


  • public class LRU<K,​V>
    extends java.lang.Object
    Evicts the least-recently-used key when capacity is exceeded. Ported from @phensley/cldr-utils src/lru.ts
    • Constructor Summary

      Constructors 
      Constructor Description
      LRU()  
      LRU​(int capacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V get​(K key)  
      void set​(K key, V val)  
      int size()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • LRU

        public LRU()
      • LRU

        public LRU​(int capacity)
    • Method Detail

      • size

        public int size()
      • get

        public V get​(K key)
      • set

        public void set​(K key,
                        V val)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object