Package org.xwiki.collection
Class SoftCache<K,V>
- java.lang.Object
-
- org.xwiki.collection.SoftCache<K,V>
-
- Type Parameters:
K
- the type of keys maintained by this mapV
- the type of mapped values
public class SoftCache<K,V> extends Object
A concurrent version ofWeakHashMap
in which the values are soft references.- Since:
- 10.8RC1, 9.11.8
- Version:
- $Id: a81a91e45923397c7b064d225402cc1819f2b3f7 $
-
-
Constructor Summary
Constructors Constructor Description SoftCache()
-
-
-
Method Detail
-
get
public V get(K key)
- Parameters:
key
- the entry key- Returns:
- the value associated to the passed key
-
get
public V get(K key, V defaultValue)
Get the value associated to the passed key. If no value can be found store and return the passed default value.- Parameters:
key
- the entry keydefaultValue
- the default value- Returns:
- the value associated to the passed key
-
-