public class NullSafeConcurrentHashMap extends ConcurrentHashMap
ConcurrentHashMap
that allows null keys and values.
In exchange, it weakens the contract of putIfAbsent(java.lang.Object, java.lang.Object)
and the other
concurrent methods added in #ConcurrentHashMap
.Modifier and Type | Class and Description |
---|---|
static interface |
NullSafeConcurrentHashMap.KeyFilter |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
NullSafeConcurrentHashMap() |
NullSafeConcurrentHashMap(int size,
float load,
int concurrencyLevel) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Object value) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Enumeration |
elements() |
Set |
entrySet() |
Object |
get(Object key) |
Enumeration |
keys() |
Set |
keySet() |
Object |
put(Object key,
Object value) |
Object |
putIfAbsent(Object key,
Object value) |
Iterator<Map.Entry> |
randomEntryIterator()
The returned data structure should not be shared among multiple
threads.
|
Object |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
Map.Entry |
removeRandom() |
Object |
replace(Object key,
Object value) |
boolean |
replace(Object key,
Object oldValue,
Object newValue) |
Collection |
values() |
clear, isEmpty, putAll, size
clone, equals, hashCode, toString
public NullSafeConcurrentHashMap(int size, float load, int concurrencyLevel)
public NullSafeConcurrentHashMap()
public Map.Entry removeRandom()
public Iterator<Map.Entry> randomEntryIterator()
public Object remove(Object key)
remove
in interface Map
remove
in class ConcurrentHashMap
public boolean remove(Object key, Object value)
remove
in interface ConcurrentMap
remove
in class ConcurrentHashMap
public boolean replace(Object key, Object oldValue, Object newValue)
replace
in interface ConcurrentMap
replace
in class ConcurrentHashMap
public Object replace(Object key, Object value)
replace
in interface ConcurrentMap
replace
in class ConcurrentHashMap
public Object putIfAbsent(Object key, Object value)
putIfAbsent
in interface ConcurrentMap
putIfAbsent
in class ConcurrentHashMap
public Object put(Object key, Object value)
put
in interface Map
put
in class ConcurrentHashMap
public Object get(Object key)
get
in interface Map
get
in class ConcurrentHashMap
public boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in class ConcurrentHashMap
public boolean containsValue(Object value)
containsValue
in interface Map
containsValue
in class ConcurrentHashMap
public boolean contains(Object value)
contains
in class ConcurrentHashMap
public Enumeration elements()
elements
in class ConcurrentHashMap
public Set entrySet()
entrySet
in interface Map
entrySet
in class ConcurrentHashMap
public Enumeration keys()
keys
in class ConcurrentHashMap
public Set keySet()
keySet
in interface Map
keySet
in class ConcurrentHashMap
public Collection values()
values
in interface Map
values
in class ConcurrentHashMap
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.