Top Description Fields Constructors Methods
org.codehaus.groovy.runtime.memoize

public Class ConcurrentSoftCache<K, V>

extends ConcurrentCommonCache<K, SoftReference<V>>
Class Inheritance
Type Parameters
<K>
key type
<V>
real value type
Imports
java.lang.ref.SoftReference, java.util.Map

Represents concurrent cache holding SoftReference instance as value

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
ConcurrentSoftCache()

Constructs a cache with unlimited size

public
ConcurrentSoftCache(int
initial capacity of the cache
initialCapacity
,
int
max size of the cache
maxSize
,
EvictableCache.EvictionStrategy evictionStrategy)

Constructs a cache with limited size

public
ConcurrentSoftCache(int
initial capacity of the LRU cache
initialCapacity
,
int
max size of the LRU cache
maxSize
)

Constructs a LRU cache with the specified initial capacity and max size.

public
ConcurrentSoftCache(int
max size of the LRU cache
maxSize
)

Constructs a LRU cache with the default initial capacity(16)

public
ConcurrentSoftCache(Map<K, SoftReference<V>>
the java.util.Map instance
map
)

Constructs a cache backed by the specified java.util.Map instance

Method Summary

Modifier and TypeMethod and Description
public Object
Inherited from org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache:
cleanUpNullReferencesclearAllcontainsKeycontainsValueentrySetgetgetAndPutgetAndPutisEmptykeyskeySetputputAllremovesizevalues

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.serialVersionUID.

Constructor Detail

ConcurrentSoftCacheback to summary
public ConcurrentSoftCache()

Constructs a cache with unlimited size

ConcurrentSoftCacheback to summary
public ConcurrentSoftCache(int initialCapacity, int maxSize, EvictableCache.EvictionStrategy evictionStrategy)

Constructs a cache with limited size

Parameters
initialCapacity:int

initial capacity of the cache

maxSize:int

max size of the cache

evictionStrategy:EvictableCache.EvictionStrategy

LRU or FIFO, see org.codehaus.groovy.runtime.memoize.EvictableCache.EvictionStrategy

ConcurrentSoftCacheback to summary
public ConcurrentSoftCache(int initialCapacity, int maxSize)

Constructs a LRU cache with the specified initial capacity and max size. The LRU cache is slower than LRUCache

Parameters
initialCapacity:int

initial capacity of the LRU cache

maxSize:int

max size of the LRU cache

ConcurrentSoftCacheback to summary
public ConcurrentSoftCache(int maxSize)

Constructs a LRU cache with the default initial capacity(16)

Parameters
maxSize:int

max size of the LRU cache

See Also
ConcurrentSoftCache(int, int)
ConcurrentSoftCacheback to summary
public ConcurrentSoftCache(Map<K, SoftReference<V>> map)

Constructs a cache backed by the specified java.util.Map instance

Parameters
map:Map<K, SoftReference<V>>

the java.util.Map instance

Method Detail

convertValueback to summary
public Object convertValue(SoftReference<V> value)

Overrides org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.convertValue.

Implements org.codehaus.groovy.runtime.memoize.ValueConvertable.convertValue.

Doc from org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.convertValue.

convert the original value to the target value

Parameters
value:SoftReference<V>

Doc from org.codehaus.groovy.runtime.memoize.ValueConvertable.convertValue.

the original value

Returns:Object

Doc from org.codehaus.groovy.runtime.memoize.ValueConvertable.convertValue.

the converted value

Annotations
@Override