IdentityHashMap (Java SE 25 & JDK 25)
- Type Parameters:
K- the type of keys maintained by this mapV- the type of mapped values
- All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>
-
Nested Class Summary
-
Constructor Summary
Constructors
Constructs a new, empty identity hash map with a default expected maximum size (21).
IdentityHashMap(int expectedMaxSize) Constructs a new, empty map with the specified expected maximum size.
IdentityHashMap(Map<? extends K, ? extends V> m) Constructs a new identity hash map containing the key-value mappings in the specified map.
-
Method Summary
voidclear()Removes all of the mappings from this map.
clone()Returns a shallow copy of this identity hash map: the keys and values themselves are not cloned.
booleanTests whether the specified object reference is a key in this identity hash map.
booleanTests whether the specified object reference is a value in this identity hash map.
entrySet()Returns a
Setview of the mappings contained in this map.booleanCompares the specified object with this map for equality.
Returns the value to which the specified key is mapped, or
nullif this map contains no mapping for the key.inthashCode()Returns the hash code value for this map.
booleanisEmpty()Returns
trueif this identity hash map contains no key-value mappings.keySet()Returns an identity-based set view of the keys contained in this map.
Associates the specified value with the specified key in this identity hash map.
voidputAll(Map<? extends K, ? extends V> m) Copies all of the mappings from the specified map to this map.
Removes the mapping for this key from this map if present.
booleanRemoves the entry for the specified key only if it is currently mapped to the specified value (optional operation).
booleanreplace(K key, V oldValue, V newValue) Replaces the entry for the specified key only if currently mapped to the specified value (optional operation).
intsize()Returns the number of key-value mappings in this identity hash map.
values()Returns a
Collectionview of the values contained in this map.
-
Constructor Details
-
IdentityHashMap
-
IdentityHashMap
-
IdentityHashMap
-
-
Method Details
-
size
-
isEmpty
-
get
-
containsKey
-
containsValue
-
put
-
putAll
-
remove
-
clear
-
equals
-
hashCode
-
clone
-
keySet
-
values
-
entrySet
-
remove
-
replace
-