예제 #1
0
 public void addToEntry(final K key, final V value) {
   cache.execute(
       new SmartCache.SmartCacheTask<K, V>() {
         public void execute(Iterator<Map.Entry<K, V>> iterator) {
           // iterator is ignored,
           // we're updating a single entry and
           // we have the key.
           if (cache.get(key) == null) {
             cache.put(key, value);
           } else {
             cache.get(key).addAll(value);
           }
         }
       });
 }
예제 #2
0
 public V get(K key) {
   return cache.get(key);
 }
예제 #3
0
 public void clear() {
   cache.clear();
 }
예제 #4
0
 public V put(final K key, final V value) {
   return cache.put(key, value);
 }