public class LeastRecentlyUsedCacheMap extends Object implements CacheMap
CacheMap| Constructor and Description |
|---|
LeastRecentlyUsedCacheMap(int maxSize)
The constructor of the cache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Object key,
Object value)
Add the key-value pair to the cache.
|
void |
clear()
Remove all entries from the cache.
|
Object |
get(Object key)
Returns the value for the key in case there is one.
|
Object |
remove(Object key)
Remove the entry denoted by key from the cache and return its value.
|
int |
size()
Return the current size of the cache.
|
public LeastRecentlyUsedCacheMap(int maxSize)
maxSize - The max number of entries in the cachepublic Object get(Object key)
get in interface CacheMapkey - The key for the value to returnCacheMap.get(java.lang.Object)public void add(Object key, Object value)
add in interface CacheMapkey - The key for the valuevalue - The value for the keyCacheMap.add(java.lang.Object, java.lang.Object)public Object remove(Object key)
remove in interface CacheMapkey - The key of the entry to be removedCacheMap.remove(java.lang.Object)public int size()
size in interface CacheMapCacheMap.size()public void clear()
clear in interface CacheMapCacheMap.clear()Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.