Package org.plumelib.util
Class UnmodifiableIdentityHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.IdentityHashMap<K,V>
org.plumelib.util.UnmodifiableIdentityHashMap<K,V>
- Type Parameters:
K- the type of keys of the mapV- the type of values of the map
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
Returns an unmodifiable view of an
IdentityHashMap. All mutating operations throw UnsupportedOperationException, and all other operations delegate to the underlying map. It is
possible that another alias to the underlying map asynchronously changes the contents of the
underlying map.
This class extends IdentityHashMap only so it is assignable to variables/fields of
static type IdentityHashMap. Any inherited state from the superclass is unused, because
all valid operations are delegated to the wrapped map.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()@Nullable V@PolyNull VcomputeIfAbsent(K key, Function<? super K, ? extends @PolyNull V> mappingFunction) @Nullable VcomputeIfPresent(K key, BiFunction<? super K, ? super V, ? extends @Nullable V> remappingFunction) booleancontainsKey(@GuardSatisfied @Nullable @UnknownSignedness Object key) booleancontainsValue(@GuardSatisfied @Nullable @UnknownSignedness Object value) entrySet()booleanvoidforEach(BiConsumer<? super K, ? super V> action) @Nullable VgetOrDefault(@GuardSatisfied @UnknownSignedness Object key, V defaultValue) inthashCode()booleanisEmpty()keySet()@Nullable V@Nullable VvoidputIfAbsent(K key, V value) @Nullable Vbooleanremove(@GuardSatisfied @UnknownSignedness Object key, @GuardSatisfied @UnknownSignedness Object value) booleanvoidreplaceAll(BiFunction<? super K, ? super V, ? extends V> function) @org.checkerframework.checker.index.qual.NonNegative intsize()toString()values()static <K,V> UnmodifiableIdentityHashMap <K, V> wrap(IdentityHashMap<K, V> map) Creates anUnmodifiableIdentityHashMapwrapper for a map.Methods inherited from class java.util.IdentityHashMap
clone
-
Method Details
-
wrap
Creates anUnmodifiableIdentityHashMapwrapper for a map. Returns the argument if it is already anUnmodifiableIdentityHashMap.- Type Parameters:
K- the key typeV- the value type- Parameters:
map- the map to wrap- Returns:
- the wrapper
-
size
public @org.checkerframework.checker.index.qual.NonNegative int size(@GuardSatisfied UnmodifiableIdentityHashMap<K, V> this) -
isEmpty
public boolean isEmpty(@GuardSatisfied UnmodifiableIdentityHashMap<K, V> this) -
get
-
containsKey
public boolean containsKey(@GuardSatisfied UnmodifiableIdentityHashMap<K, V> this, @GuardSatisfied @Nullable @UnknownSignedness Object key) - Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classIdentityHashMap<K,V>
-
containsValue
public boolean containsValue(@GuardSatisfied UnmodifiableIdentityHashMap<K, V> this, @GuardSatisfied @Nullable @UnknownSignedness Object value) - Specified by:
containsValuein interfaceMap<K,V> - Overrides:
containsValuein classIdentityHashMap<K,V>
-
put
-
putAll
-
remove
-
clear
public void clear(@GuardSatisfied UnmodifiableIdentityHashMap<K, V> this) -
equals
public boolean equals(@GuardSatisfied UnmodifiableIdentityHashMap<K, V> this, @Nullable @GuardSatisfied Object o) -
hashCode
public int hashCode(@GuardSatisfied UnmodifiableIdentityHashMap<K, V> this) -
keySet
-
values
-
entrySet
-
forEach
-
replaceAll
- Specified by:
replaceAllin interfaceMap<K,V> - Overrides:
replaceAllin classIdentityHashMap<K,V>
-
toString
- Overrides:
toStringin classAbstractMap<K,V>
-
getOrDefault
-
putIfAbsent
-
remove
-
replace
-
replace
-
computeIfAbsent
-
computeIfPresent
-
compute
-
merge
-