Class LRUCache<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- org.wso2.carbon.governance.api.cache.LRUCache<K,V>
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
public class LRUCache<K,V> extends LinkedHashMap<K,V>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description LRUCache(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidexclusiveLock()Vget(Object key)protected voidhandleRemovableEntry(Map.Entry<K,V> entry)Vput(K key, V value)voidrelease()Vremove(Object key)protected booleanremoveEldestEntry(Map.Entry eldest)-
Methods inherited from class java.util.LinkedHashMap
containsValue, entrySet, forEach, getOrDefault, keySet, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, size
-
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
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, size
-
-
-
-
Method Detail
-
clear
public void clear()
-
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry eldest)
- Overrides:
removeEldestEntryin classLinkedHashMap<K,V>
-
exclusiveLock
public void exclusiveLock()
-
release
public void release()
-
-