Package org.jppf.caching
Class JPPFSynchronizedSoftCache<K,V>
java.lang.Object
org.jppf.caching.JPPFSynchronizedSoftCache<K,V>
- Type Parameters:
K- the type of keys.V- the type of values.
- All Implemented Interfaces:
JPPFMapCache<K,V>
Cache implementation which uses a
SoftReferenceValuesMap with synchronized access.- Author:
- Laurent Cohen
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JPPFSynchronizedSoftCache
public JPPFSynchronizedSoftCache()
-
-
Method Details
-
put
Description copied from interface:JPPFMapCachePut an element in the cache.- Specified by:
putin interfaceJPPFMapCache<K,V> - Parameters:
key- the element's key for retrival.value- the element's value.
-
get
Description copied from interface:JPPFMapCacheGet an element in the cache.- Specified by:
getin interfaceJPPFMapCache<K,V> - Parameters:
key- the element's key.- Returns:
- the value of the element, or
nullif the element is not in the cache.
-
remove
Description copied from interface:JPPFMapCacheRemove an element from the cache.- Specified by:
removein interfaceJPPFMapCache<K,V> - Parameters:
key- the element's key.- Returns:
- the value of the removed element, or
nullif the element is not in the cache.
-
clear
public void clear()Description copied from interface:JPPFMapCacheClear the cache. This removes all elements from the cache.- Specified by:
clearin interfaceJPPFMapCache<K,V>
-
has
Description copied from interface:JPPFMapCacheDetermine whether an entry with the specified key is in the cache.- Specified by:
hasin interfaceJPPFMapCache<K,V> - Parameters:
key- the key to look up.- Returns:
trueif the key is in the cache,falseotherwise.
-