Package org.jppf.caching
Interface JPPFMapCache<K,V>
- Type Parameters:
K- the type of keys.V- the type of values.
- All Known Implementing Classes:
AbstractJPPFMapCache,JPPFHashMapCache,JPPFLRUMapCache,JPPFSynchronizedSoftCache
public interface JPPFMapCache<K,V>
Interface for caches implementations with a map-like API.
- Author:
- Laurent Cohen
-
Method Summary
-
Method Details
-
put
Put an element in the cache.- Parameters:
key- the element's key for retrival.value- the element's value.
-
has
Determine whether an entry with the specified key is in the cache.- Parameters:
key- the key to look up.- Returns:
trueif the key is in the cache,falseotherwise.
-
get
Get an element in the cache.- Parameters:
key- the element's key.- Returns:
- the value of the element, or
nullif the element is not in the cache.
-
remove
Remove an element from the cache.- Parameters:
key- the element's key.- Returns:
- the value of the removed element, or
nullif the element is not in the cache.
-
clear
void clear()Clear the cache. This removes all elements from the cache.
-