Class ConcurrentSoftCache<K,V> 
java.lang.Object
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache<K,SoftReference<V>>
 
org.codehaus.groovy.runtime.memoize.ConcurrentSoftCache<K,V> 
- Type Parameters:
- K- key type
- V- real value type
- All Implemented Interfaces:
- Serializable,- Map<K,,- SoftReference<V>> - EvictableCache<K,,- SoftReference<V>> - FlexibleEvictableCache<K,,- SoftReference<V>> - MemoizeCache<K,,- SoftReference<V>> - ValueConvertable<SoftReference<V>,- Object> 
Represents concurrent cache holding SoftReference instance as value
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.codehaus.groovy.runtime.memoize.EvictableCacheEvictableCache.Action<K,V, R>, EvictableCache.EvictionStrategy Nested classes/interfaces inherited from interface java.util.MapMap.Entry<K extends Object,V extends Object> Nested classes/interfaces inherited from interface org.codehaus.groovy.runtime.memoize.MemoizeCacheMemoizeCache.ValueProvider<K,V> 
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a cache with unlimited sizeConcurrentSoftCache(int maxSize) Constructs an LRU cache with the default initial capacity(16)ConcurrentSoftCache(int initialCapacity, int maxSize) Constructs an LRU cache with the specified initial capacity and max size.ConcurrentSoftCache(int initialCapacity, int maxSize, EvictableCache.EvictionStrategy evictionStrategy) Constructs a cache with limited sizeConcurrentSoftCache(Map<K, SoftReference<V>> map) Constructs a cache backed by the specifiedMapinstance
- 
Method SummaryModifier and TypeMethodDescriptionconvertValue(SoftReference<V> value) convert the original value to the target valueMethods inherited from class org.codehaus.groovy.runtime.memoize.ConcurrentCommonCachecleanUpNullReferences, clearAll, containsKey, containsValue, entrySet, get, getAndPut, getAndPut, isEmpty, keys, keySet, put, putAll, remove, size, valuesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codehaus.groovy.runtime.memoize.EvictableCacheclearMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Constructor Details- 
ConcurrentSoftCachepublic ConcurrentSoftCache()Constructs a cache with unlimited size
- 
ConcurrentSoftCachepublic ConcurrentSoftCache(int initialCapacity, int maxSize, EvictableCache.EvictionStrategy evictionStrategy) Constructs a cache with limited size- Parameters:
- initialCapacity- initial capacity of the cache
- maxSize- max size of the cache
- evictionStrategy- LRU or FIFO, see- EvictableCache.EvictionStrategy
 
- 
ConcurrentSoftCachepublic ConcurrentSoftCache(int initialCapacity, int maxSize) Constructs an LRU cache with the specified initial capacity and max size. The LRU cache is slower thanLRUCache- Parameters:
- initialCapacity- initial capacity of the LRU cache
- maxSize- max size of the LRU cache
 
- 
ConcurrentSoftCachepublic ConcurrentSoftCache(int maxSize) Constructs an LRU cache with the default initial capacity(16)- Parameters:
- maxSize- max size of the LRU cache
- See Also:
 
- 
ConcurrentSoftCacheConstructs a cache backed by the specifiedMapinstance- Parameters:
- map- the- Mapinstance
 
 
- 
- 
Method Details- 
convertValueconvert the original value to the target value- Specified by:
- convertValuein interface- ValueConvertable<K,- V> 
- Overrides:
- convertValuein class- ConcurrentCommonCache<K,- SoftReference<V>> 
- Parameters:
- value- the original value
- Returns:
- the converted value
 
 
-