|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
net.sf.ehcache.store.LruMemoryStore.SpoolingLinkedHashMap
public final class LruMemoryStore.SpoolingLinkedHashMap
An extension of LinkedHashMap which overrides removeEldestEntry(java.util.Map.Entry)
to persist cache entries to the auxiliary cache before they are removed.
This implementation also provides LRU by access order.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
LruMemoryStore.SpoolingLinkedHashMap()
Default constructor. |
Method Summary | |
---|---|
boolean |
isPinned(Object key)
Check if the key is pinned |
Object |
put(Object key,
Object value)
|
protected boolean |
removeEldestEntry(Map.Entry eldest)
Returns true if this map should remove its eldest entry. |
void |
setPinning(Object key,
boolean pinned)
Mark the key as pinned or not |
void |
unpinAll()
unpin all pinned keys |
Methods inherited from class java.util.LinkedHashMap |
---|
clear, containsValue, get |
Methods inherited from class java.util.HashMap |
---|
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
containsKey, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values |
Constructor Detail |
---|
public LruMemoryStore.SpoolingLinkedHashMap()
Method Detail |
---|
public void setPinning(Object key, boolean pinned)
key
- the key to be pinned or notpinned
- true if the key should be pinned, false otherwisepublic boolean isPinned(Object key)
key
- the key to be checked
public void unpinAll()
protected final boolean removeEldestEntry(Map.Entry eldest)
Will return true if:
removeEldestEntry
in class LinkedHashMap
eldest
- The least recently inserted entry in the map, or if
this is an access-ordered map, the least recently accessed
entry. This is the entry that will be removed it this
method returns true. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.
public Object put(Object key, Object value)
put
in interface Map
put
in class HashMap
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |