K - Type of the keys.V - Type of the values.public class MapBackedHashMap<K,V>
extends HashMap<K,V>
HashMap that is a live view of another Map: every operation is delegated to the
backing map (the inherited HashMap state stays empty). This keeps public APIs that historically
returned a HashMap source and binary compatible while the data is held in a more compact map such
as CompactStringMap.| Constructor and Description |
|---|
MapBackedHashMap(Map<K,V> map) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
Object |
clone() |
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) |
void |
forEach(BiConsumer<? super K,? super V> action) |
V |
get(Object key) |
Map<K,V> |
getBackingMap() |
V |
getOrDefault(Object key,
V defaultValue) |
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
merge(K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
putIfAbsent(K key,
V 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) |
void |
replaceAll(BiFunction<? super K,? super V,? extends V> function) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
public int size()
public boolean isEmpty()
public V get(Object key)
public boolean containsKey(Object key)
public V remove(Object key)
public void clear()
public boolean containsValue(Object value)
public Set<K> keySet()
public Collection<V> values()
public boolean remove(Object key,
Object value)
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
public Object clone()
public boolean equals(Object o)
public int hashCode()