Class SimpleCache<K,V>

java.lang.Object
com.ctc.wstx.util.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.

  • Field Details

  • Constructor Details

    • SimpleCache

      public SimpleCache(int maxSize)
  • Method Details

    • find

      public V find(K key)
    • add

      public void add(K key, V value)