K
- the key typeV
- the value typeC
- the collection typepublic abstract class AbstractSynchronizedMultiMap<K,V,C extends Collection<V>> extends AbstractDelegatingMultiMap<K,V,C>
HashMap
Collections.synchronizedMap(java.util.Map)
,
Serialized FormModifier and Type | Field and Description |
---|---|
private Map<K,C> |
delegate |
private ReadWriteLock |
lock |
private Lock |
read |
private static long |
serialVersionUID |
private Lock |
write |
Constructor and Description |
---|
AbstractSynchronizedMultiMap() |
AbstractSynchronizedMultiMap(int initialCapacity) |
AbstractSynchronizedMultiMap(int initialCapacity,
float loadFactor) |
AbstractSynchronizedMultiMap(Map<? extends K,? extends C> m) |
Modifier and Type | Method and Description |
---|---|
C |
add(K key,
V value)
Adds the specified value to the key.
|
C |
addAll(K key,
Collection<? extends V> values)
Adds the specified values to the key.
|
C |
allValues() |
void |
clear() |
boolean |
containsCollectionValue(V v)
Checks if any collection of any key contains
v . |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,C>> |
entrySet() |
boolean |
equals(Object o) |
C |
get(Object key) |
protected Map<K,C> |
getDelegate() |
int |
hashCode() |
boolean |
hasValues(K key)
Checks if the specified key is contained in this map and if the
associated collection is not empty.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
C |
put(K key,
C value) |
void |
putAll(Map<? extends K,? extends C> m) |
boolean |
remove(K key,
Iterable<V> value)
Removes the values of the collection for the specified key (if it
exists).
|
C |
remove(Object key) |
boolean |
remove(Object k,
Object v)
Removes the value of the collection for the specified key (if it exists).
|
boolean |
removeWithKey(K key,
Iterable<V> value)
Removes the specified values of the collection for the specified key (if
it exists).
|
boolean |
removeWithKey(K key,
V value)
Removes the specified value of the collection for the specified key (if
it exists).
|
int |
size() |
Collection<C> |
values() |
newCollection
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, replace, replace, replaceAll
private static final long serialVersionUID
private final ReadWriteLock lock
private final Lock read
private final Lock write
private final Map<K,C extends Collection<V>> delegate
public AbstractSynchronizedMultiMap(int initialCapacity)
public AbstractSynchronizedMultiMap(int initialCapacity, float loadFactor)
public AbstractSynchronizedMultiMap()
protected Map<K,C> getDelegate()
getDelegate
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public int size()
size
in interface Map<K,C extends Collection<V>>
size
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public boolean isEmpty()
isEmpty
in interface Map<K,C extends Collection<V>>
isEmpty
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public boolean containsKey(Object key)
containsKey
in interface Map<K,C extends Collection<V>>
containsKey
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public boolean containsValue(Object value)
containsValue
in interface Map<K,C extends Collection<V>>
containsValue
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public C get(Object key)
get
in interface Map<K,C extends Collection<V>>
get
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public C put(K key, C value)
put
in interface Map<K,C extends Collection<V>>
put
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public C add(K key, V value)
MultiMap
null
it will be created.add
in interface MultiMap<K,V,C extends Collection<V>>
add
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
key
- the keyvalue
- the valuepublic C remove(Object key)
remove
in interface Map<K,C extends Collection<V>>
remove
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public boolean remove(Object k, Object v)
MultiMap
remove
in interface Map<K,C extends Collection<V>>
remove
in interface MultiMap<K,V,C extends Collection<V>>
remove
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
k
- the keyv
- the value to removepublic void putAll(Map<? extends K,? extends C> m)
putAll
in interface Map<K,C extends Collection<V>>
putAll
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public void clear()
clear
in interface Map<K,C extends Collection<V>>
clear
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public Set<K> keySet()
keySet
in interface Map<K,C extends Collection<V>>
keySet
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public Collection<C> values()
values
in interface Map<K,C extends Collection<V>>
values
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public C allValues()
allValues
in interface MultiMap<K,V,C extends Collection<V>>
allValues
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public Set<Map.Entry<K,C>> entrySet()
entrySet
in interface Map<K,C extends Collection<V>>
entrySet
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public boolean equals(Object o)
equals
in interface Map<K,C extends Collection<V>>
equals
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public int hashCode()
hashCode
in interface Map<K,C extends Collection<V>>
hashCode
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
public boolean containsCollectionValue(V v)
MultiMap
v
.containsCollectionValue
in interface MultiMap<K,V,C extends Collection<V>>
containsCollectionValue
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
v
- the element to checkpublic boolean remove(K key, Iterable<V> value)
MultiMap
remove
in interface MultiMap<K,V,C extends Collection<V>>
remove
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
key
- the keyvalue
- the values to removepublic boolean hasValues(K key)
MultiMap
hasValues
in interface MultiMap<K,V,C extends Collection<V>>
hasValues
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
key
- the keypublic C addAll(K key, Collection<? extends V> values)
MultiMap
null
it will be created.addAll
in interface MultiMap<K,V,C extends Collection<V>>
addAll
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
key
- the keyvalues
- the valuespublic boolean removeWithKey(K key, V value)
MultiMap
removeWithKey
in interface MultiMap<K,V,C extends Collection<V>>
removeWithKey
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
key
- the keyvalue
- the valuepublic boolean removeWithKey(K key, Iterable<V> value)
MultiMap
removeWithKey
in interface MultiMap<K,V,C extends Collection<V>>
removeWithKey
in class AbstractDelegatingMultiMap<K,V,C extends Collection<V>>
key
- the keyvalue
- the valueCopyright © 2012-2015 52north.org. All Rights Reserved.