public synchronized V put(K key, V value) { Element<V> element = new Element<V>(); element.date = System.currentTimeMillis(); element.value = value; map.put(key, element); return value; }
public synchronized V get(K key) { V value = null; Element<V> element = map.get(key); if (element != null) { element.date = System.currentTimeMillis(); value = element.value; } return value; }