Interface MemoizeCache<K,V>
- 
- Type Parameters:
- K- type of the keys
- V- type of the values
 - All Known Subinterfaces:
- EvictableCache<K,V>
 - All Known Implementing Classes:
- CommonCache,- ConcurrentCommonCache,- ConcurrentSoftCache,- LRUCache,- UnlimitedConcurrentCache
 
 public interface MemoizeCache<K,V>Represents a memoize cache with its essential methods
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceMemoizeCache.ValueProvider<K,V>Represents a provider used to create value
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcleanUpNullReferences()Invoked when some of the held SoftReferences have been evicted by the garbage collector and so should be removed from the cache.Vget(K key)Gets a value from the cacheVgetAndPut(K key, MemoizeCache.ValueProvider<? super K,? extends V> valueProvider)Try to get the value from cache.Vput(K key, V value)Associates the specified value with the specified key in the cache.
 
- 
- 
- 
Method Detail- 
putV put(K key, V value) Associates the specified value with the specified key in the cache.- Parameters:
- key- key with which the specified value is to be associated
- value- value to be associated with the specified key
- Returns:
- null, or the old value if the key associated with the specified key.
 
 - 
getV get(K key) Gets a value from the cache- Parameters:
- key- the key whose associated value is to be returned
- Returns:
- the value, or null, if it does not exist.
 
 - 
getAndPutV getAndPut(K key, MemoizeCache.ValueProvider<? super K,? extends V> valueProvider) Try to get the value from cache. If not found, create the value byMemoizeCache.ValueProviderand put it into the cache, at last return the value- Parameters:
- key-
- Returns:
- the cached value
 
 - 
cleanUpNullReferencesvoid cleanUpNullReferences() Invoked when some of the held SoftReferences have been evicted by the garbage collector and so should be removed from the cache. The implementation must ensure that concurrent invocations of all methods on the cache may occur from other threads and thus should protect any shared resources.
 
- 
 
-