Package aQute.bnd.unmodifiable
Class ImmutableMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- aQute.bnd.unmodifiable.ImmutableMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.Map<K,V>
final class ImmutableMap<K,V> extends java.util.AbstractMap<K,V> implements java.util.Map<K,V>, java.io.Serializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ImmutableMap.ElementCollection<E>
(package private) static class
ImmutableMap.ElementSet<E>
(package private) static class
ImmutableMap.EntrySet<K,V>
(package private) static class
ImmutableMap.KeySet<K>
private static class
ImmutableMap.SerializationProxy
(package private) static class
ImmutableMap.ValueCollection<V>
-
Field Summary
Fields Modifier and Type Field Description (package private) static ImmutableMap<?,?>
EMPTY
(package private) java.lang.Object[]
entries
(package private) short[]
hash_bucket
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ImmutableMap(java.lang.Object... 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)
void
forEach(java.util.function.BiConsumer<? super K,? super V> action)
V
get(java.lang.Object key)
private static short[]
hash(java.lang.Object[] entries)
int
hashCode()
java.util.Set<K>
keySet()
private int
linear_probe(java.lang.Object key)
private static int
linear_probe(java.lang.Object[] entries, short[] 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)
private void
readObject(java.io.ObjectInputStream ois)
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()
java.util.Collection<V>
values()
private java.lang.Object
writeReplace()
-
-
-
Field Detail
-
EMPTY
static final ImmutableMap<?,?> EMPTY
-
entries
final java.lang.Object[] entries
-
hash_bucket
final transient short[] hash_bucket
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
hash
private static short[] hash(java.lang.Object[] entries)
-
linear_probe
private static int linear_probe(java.lang.Object[] entries, short[] 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()
-
keySet
public java.util.Set<K> keySet()
-
values
public java.util.Collection<V> values()
-
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)
-
merge
public V merge(K key, V value, java.util.function.BiFunction<? super V,? super V,? extends V> remappingFunction)
-
readObject
private void readObject(java.io.ObjectInputStream ois) throws java.io.InvalidObjectException
- Throws:
java.io.InvalidObjectException
-
writeReplace
private java.lang.Object writeReplace()
-
-