|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.util.ConcurrentCacheMap<K,V>
public class ConcurrentCacheMap<K,V>
An implementation of CacheMap that allows null keys and values.
The data is stored in a ConcurrentHashMap
giving it high throughput under load.
It uses a special token to transparently store null keys and values which are not natively supported by ConcurrentHashMap
.
Constructor Summary | |
---|---|
ConcurrentCacheMap()
|
Method Summary | |
---|---|
void |
clear()
Removes all of the mappings from this cache. |
Collection<V> |
copyOfValues()
Returns a Collection view of the values contained in this cache. |
V |
get(K key)
Returns the value to which the specified key is mapped, or null if this cache contains no mapping for the key. |
void |
put(K key,
V value)
Maps the specified key to the specified value in this cache. |
void |
remove(K key)
Removes the key (and its corresponding value) from this cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConcurrentCacheMap()
Method Detail |
---|
public V get(K key)
CacheMap
null
if this cache contains no mapping for the key.
get
in interface CacheMap<K,V>
key
- the key.
public void put(K key, V value)
CacheMap
The value can be retrieved by calling the get method with a key that is equal to the original key.
put
in interface CacheMap<K,V>
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keypublic void clear()
CacheMap
clear
in interface CacheMap<K,V>
public void remove(K key)
CacheMap
remove
in interface CacheMap<K,V>
key
- the key that needs to be removedpublic Collection<V> copyOfValues()
CacheMap
Collection
view of the values contained in this cache.
The collection is a copy of the values that were contained at the time that this operation was called. Concurrent implementations of this interface will likely allow mutating operations to occur while the collection is being constructed, and which of these modifications are in the resulting collection will be timing and implementation dependant.
copyOfValues
in interface CacheMap<K,V>
Collection
view of the values contained in this cache.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |