public V get(K key) { V result = null; CacheableObject<V> co = cache.get(key); if (co != null) { result = co.getValue(); } return result; }
public V remove(K key) { CacheableObject<V> co = cache.remove(key); V result = null; if (co != null) { result = co.getValue(); } return result; }
@Override public void run() { synchronized (cache) { Enumeration<K> e = cache.keys(); while (e.hasMoreElements()) { K key = e.nextElement(); CacheableObject co = cache.get(key); if (co != null && co.isReadyToDie(expiration)) { cache.remove(key); } } } }