| Constructor and Description |
|---|
MapCache(String name,
Map<K,V> backingMap) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all entries from the cache.
|
V |
get(K key)
Returns the Cached value stored under the specified
key or
null if there is no Cache entry for that key. |
Set<K> |
keys()
Returns a view of all the keys for entries contained in this cache.
|
V |
put(K key,
V value)
Adds a Cache entry.
|
V |
remove(K key)
Remove the cache entry corresponding to the specified key.
|
int |
size()
Returns the number of entries in the cache.
|
String |
toString() |
Collection<V> |
values()
Returns a view of all of the values contained in this cache.
|
public V get(K key) throws CacheException
Cachekey or
null if there is no Cache entry for that key.get in interface Cache<K,V>key - the key that the value was previous added withnull if there is no entry for the specified keyCacheException - if there is a problem accessing the underlying cache systempublic V put(K key, V value) throws CacheException
Cacheput in interface Cache<K,V>key - the key used to identify the object being stored.value - the value to be stored in the cache.key or null if there was previous valueCacheException - if there is a problem accessing the underlying cache systempublic V remove(K key) throws CacheException
Cacheremove in interface Cache<K,V>key - the key of the entry to be removed.key or null if there was previous valueCacheException - if there is a problem accessing the underlying cache systempublic void clear()
throws CacheException
Cacheclear in interface Cache<K,V>CacheException - if there is a problem accessing the underlying cache systempublic int size()
Cachepublic Set<K> keys()
Cachepublic Collection<V> values()
CacheCopyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.