@NotThreadSafe public class CompositeMap<K,V> extends AbstractMap<K,V>
Restrictions:
Collections.synchronizedMap(Map)
.
This class will behave in an undefined manner if
accessed by concurrent threads without synchronization.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
static <K,V> Map<K,V> |
of(Map<K,V> one,
Map<K,V> two)
Create a new CompositeMap with two composited Map instances.
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
clone, containsValue, equals, hashCode, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static <K,V> Map<K,V> of(Map<K,V> one, Map<K,V> two)
one
- the first Map to be composited, values here override values in the second.two
- the second Map to be compositedIllegalArgumentException
- if either map is nullpublic boolean isEmpty()
public int size()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
Copyright © 2002-2024 Atlassian. All Rights Reserved.