Package aQute.lib.unmodifiable
Class ImmutableMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- aQute.lib.unmodifiable.ImmutableMap<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
final class ImmutableMap<K,V> extends java.util.AbstractMap<K,V> implements java.util.Map<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static ImmutableMap<?,?>
EMPTY
(package private) java.util.Map.Entry<K,V>[]
entries
(package private) java.util.Set<java.util.Map.Entry<K,V>>
entrySet
(package private) int[]
hash_bucket
-
Constructor Summary
Constructors Constructor Description ImmutableMap(java.util.Map.Entry<K,V>... entries)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
V
compute(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
V
computeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)
V
computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
boolean
equals(java.lang.Object o)
V
get(java.lang.Object key)
private static <K,V>
int[]hash(java.util.Map.Entry<K,V>[] entries)
int
hashCode()
private int
linear_probe(java.lang.Object key)
private static <K,V>
intlinear_probe(java.util.Map.Entry<K,V>[] entries, int[] hash_bucket, java.lang.Object key)
V
merge(K key, V value, java.util.function.BiFunction<? super V,? super V,? extends V> remappingFunction)
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> map)
V
putIfAbsent(K key, V value)
V
remove(java.lang.Object key)
boolean
remove(java.lang.Object key, java.lang.Object value)
V
replace(K key, V value)
boolean
replace(K key, V oldValue, V newValue)
void
replaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)
int
size()
-
-
-
Field Detail
-
EMPTY
static final ImmutableMap<?,?> EMPTY
-
hash_bucket
final int[] hash_bucket
-
-
Method Detail
-
hash
private static <K,V> int[] hash(java.util.Map.Entry<K,V>[] entries)
-
linear_probe
private static <K,V> int linear_probe(java.util.Map.Entry<K,V>[] entries, int[] hash_bucket, java.lang.Object key)
-
linear_probe
private int linear_probe(java.lang.Object key)
-
size
public int size()
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
get
public V get(java.lang.Object key)
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
remove
public V remove(java.lang.Object key)
-
clear
public void clear()
-
replaceAll
public void replaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)
-
remove
public boolean remove(java.lang.Object key, java.lang.Object value)
-
computeIfAbsent
public V computeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)
-
computeIfPresent
public V computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
-
compute
public V compute(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
-
-