Package org.cache2k.core
Class ConcurrentMapWrapper<K,V>
- java.lang.Object
-
- org.cache2k.core.ConcurrentMapWrapper<K,V>
-
- All Implemented Interfaces:
ConcurrentMap<K,V>
,Map<K,V>
public class ConcurrentMapWrapper<K,V> extends Object implements ConcurrentMap<K,V>
ConcurrentMap interface wrapper on top of a cache. The map interface does not cause calls to the cache source. An attached writer is called.- Author:
- Jens Wilke
-
-
Constructor Summary
Constructors Constructor Description ConcurrentMapWrapper(InternalCache<K,V> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
V
compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
V
computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
V
computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<K,V>>
entrySet()
boolean
equals(Object o)
This is the object identity of the cacheV
get(Object key)
int
hashCode()
boolean
isEmpty()
Set<K>
keySet()
V
put(K key, V value)
void
putAll(Map<? extends K,? extends V> m)
V
putIfAbsent(K key, V value)
We cannot useCache.putIfAbsent(Object, Object)
since the map returns the value.V
remove(Object key)
boolean
remove(Object key, Object value)
V
replace(K key, V value)
boolean
replace(K key, V oldValue, V newValue)
int
size()
Collection<V>
values()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
forEach, getOrDefault, merge, replaceAll
-
-
-
-
Constructor Detail
-
ConcurrentMapWrapper
public ConcurrentMapWrapper(InternalCache<K,V> cache)
-
-
Method Detail
-
putIfAbsent
public V putIfAbsent(K key, V value)
We cannot useCache.putIfAbsent(Object, Object)
since the map returns the value.- Specified by:
putIfAbsent
in interfaceConcurrentMap<K,V>
- Specified by:
putIfAbsent
in interfaceMap<K,V>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<K,V>
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
- Specified by:
computeIfAbsent
in interfaceConcurrentMap<K,V>
- Specified by:
computeIfAbsent
in interfaceMap<K,V>
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
- Specified by:
computeIfPresent
in interfaceConcurrentMap<K,V>
- Specified by:
computeIfPresent
in interfaceMap<K,V>
-
equals
public boolean equals(Object o)
This is the object identity of the cache
-
-