K
- the type of keys in the mapV
- the type of values in the mappublic abstract class AbstractImmutableMap<K,V> extends AbstractMap<K,V>
ImmutableMap
s. Sub-classes only need to provide
an implementation for AbstractMap.entrySet()
. However, sub-classes are advised to also provide
implementations for AbstractMap.get(Object)
and AbstractMap.containsKey(Object)
as the default
implementations run in linear time whereas map's are usually expected to be more efficient than
that.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
AbstractImmutableMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Deprecated.
|
V |
compute(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction)
Deprecated.
|
V |
computeIfAbsent(K key,
Function<? super K,? extends V> mappingFunction)
Deprecated.
|
V |
computeIfPresent(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction)
Deprecated.
|
Set<K> |
keySet() |
V |
merge(K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction)
Deprecated.
|
V |
put(K key,
V value)
Deprecated.
|
void |
putAll(Map<? extends K,? extends V> m)
Deprecated.
|
V |
putIfAbsent(K key,
V value)
Deprecated.
|
V |
remove(Object key)
Deprecated.
|
boolean |
remove(Object key,
Object value)
Deprecated.
|
V |
replace(K key,
V value)
Deprecated.
|
boolean |
replace(K key,
V oldValue,
V newValue)
Deprecated.
|
void |
replaceAll(BiFunction<? super K,? super V,? extends V> function)
Deprecated.
|
Collection<V> |
values() |
clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, size, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, getOrDefault
@Deprecated public final V put(K key, V value)
@Deprecated public final V remove(Object key)
@Deprecated public final void putAll(Map<? extends K,? extends V> m)
@Deprecated public final void clear()
@Deprecated public final void replaceAll(BiFunction<? super K,? super V,? extends V> function)
@Deprecated public final V putIfAbsent(K key, V value)
@Deprecated public final boolean remove(Object key, Object value)
@Deprecated public final boolean replace(K key, V oldValue, V newValue)
@Deprecated public final V replace(K key, V value)
@Deprecated public final V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
@Deprecated public final V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
@Deprecated public final V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
@Deprecated public final V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
public Collection<V> values()