Class SimpleCache<K,​V>


  • public final class SimpleCache<K,​V>
    extends Object
    Simple Map implementation usable for caches where contents do not expire, but where size needs to remain bounded.

    Note: we probably should use weak references, or something similar to limit maximum memory usage. This could be implemented in many ways, perhaps by using two areas: first, smaller one, with strong refs, and secondary bigger one that uses soft references.

    • Constructor Detail

      • SimpleCache

        public SimpleCache​(int maxSize)
    • Method Detail

      • find

        public V find​(K key)
      • add

        public void add​(K key,
                        V value)