com.ctc.wstx.util
Class SimpleCache

java.lang.Object
  extended bycom.ctc.wstx.util.SimpleCache

public final class SimpleCache
extends java.lang.Object

Simple Map implementation usable for caches where contents do not expire.

TODO: for now just 'randomly' chooses entry to be removed when Map overflows... should do something smarter.

Note: what sucks is that JDK 1.4 has what would be 98% what we need, LinkedHashMap. But since Wstx aims to be 1.2 (or at the very least, 1.3) compatible, can't use it (yet?)


Constructor Summary
SimpleCache(int maxSize)
           
 
Method Summary
 void add(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object find(java.lang.Object key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCache

public SimpleCache(int maxSize)
Method Detail

find

public java.lang.Object find(java.lang.Object key)

add

public void add(java.lang.Object key,
                java.lang.Object value)