Example #1
0
 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;
 }
Example #2
0
 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;
 }