@Vetoed public class LRUCacheStore<K,V> extends LinkedHashMap<K,V> implements CacheStore<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LRUCacheStore(int capacity) |
Modifier and Type | Method and Description |
---|---|
V |
fetch(K key)
Fetches the value under the key
|
V |
fetch(K key,
Callable<V> valueProvider)
Fetches the value under the key.
|
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
V |
write(K key,
V value)
Writes a value on the cache
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry
in class LinkedHashMap<K,V>
public V fetch(K key, Callable<V> valueProvider)
CacheStore
fetch
in interface CacheStore<K,V>
public V write(K key, V value)
CacheStore
write
in interface CacheStore<K,V>
public V fetch(K key)
CacheStore
fetch
in interface CacheStore<K,V>
Copyright © 2014 Caelum. All rights reserved.