public interface CacheMap<K,V>
The cache looks a lot like a Map
and indeed implementations are likely to use a Map interally as
the data store, however not all operations are implemented or exactly the same so this interface does not extend Map.
Modifier and Type | Method and Description |
---|---|
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.
|
V get(K key)
null
if this cache contains no mapping for the key.key
- the key.void put(K key, V value)
The value can be retrieved by calling the get method with a key that is equal to the original key.
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyvoid clear()
void remove(K key)
key
- the key that needs to be removedCollection<V> copyOfValues()
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.
Collection
view of the values contained in this cache.Copyright © 2002-2018 Atlassian. All Rights Reserved.