|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.eventadmin.impl.util.LeastRecentlyUsedCacheMap
public class LeastRecentlyUsedCacheMap
This class implements a least recently used cache map. It will hold a given size of key-value pairs and drop the least recently used entry once this size is reached. This class is thread safe.
CacheMap| Constructor Summary | |
|---|---|
LeastRecentlyUsedCacheMap(int maxSize)
The constructor of the cache. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object key,
java.lang.Object value)
Add the key-value pair to the cache. |
void |
clear()
Remove all entries from the cache. |
java.lang.Object |
get(java.lang.Object key)
Returns the value for the key in case there is one. |
java.lang.Object |
remove(java.lang.Object key)
Remove the entry denoted by key from the cache and return its value. |
int |
size()
Return the current size of the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LeastRecentlyUsedCacheMap(int maxSize)
maxSize - The max number of entries in the cache| Method Detail |
|---|
public java.lang.Object get(java.lang.Object key)
get in interface CacheMapkey - The key for the value to return
CacheMap.get(java.lang.Object)
public void add(java.lang.Object key,
java.lang.Object value)
add in interface CacheMapkey - The key for the valuevalue - The value for the keyCacheMap.add(java.lang.Object, java.lang.Object)public java.lang.Object remove(java.lang.Object key)
remove in interface CacheMapkey - The key of the entry to be removed
CacheMap.remove(java.lang.Object)public int size()
size in interface CacheMapCacheMap.size()public void clear()
clear in interface CacheMapCacheMap.clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||