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 voidclear()Vcompute(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)VcomputeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)VcomputeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<K,V>>entrySet()booleanequals(java.lang.Object o)Vget(java.lang.Object key)private static <K,V>
int[]hash(java.util.Map.Entry<K,V>[] entries)inthashCode()private intlinear_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)Vmerge(K key, V value, java.util.function.BiFunction<? super V,? super V,? extends V> remappingFunction)Vput(K key, V value)voidputAll(java.util.Map<? extends K,? extends V> map)VputIfAbsent(K key, V value)Vremove(java.lang.Object key)booleanremove(java.lang.Object key, java.lang.Object value)Vreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)voidreplaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)intsize()
-
-
-
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)
-
-