public class

ConcurrentCacheMap

extends Object
implements CacheMap<K, V>
java.lang.Object
   ↳ com.atlassian.jira.util.ConcurrentCacheMap<K, V>

Class Overview

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.

Summary

Public Constructors
ConcurrentCacheMap()
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.util.CacheMap

Public Constructors

public ConcurrentCacheMap ()

Public Methods

public void clear ()

Removes all of the mappings from this cache.

public Collection<V> copyOfValues ()

Returns a 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.

Returns
  • a Collection view of the values contained in this cache.

public 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.

Parameters
key the key.
Returns
  • the value to which the specified key is mapped.

public void put (K key, V value)

Maps the specified key to the specified value in this cache.

The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters
key key with which the specified value is to be associated
value value to be associated with the specified key

public void remove (K key)

Removes the key (and its corresponding value) from this cache. This method does nothing if the key is not in the cache.

Parameters
key the key that needs to be removed