Map where keys are compared by object identity,
rather than equals().
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private transient Map. | |
| private final LinkedHashMap |
| Access | Constructor and Description |
|---|---|
| private | IdentityMap(LinkedHashMap<IdentityMap.
The delegate map. underlyingMapPrivate ctor used in serialization. |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements java. |
| public static <K, V> Map. | Returns: CollectionThe map of entries map)Return the map entries (as instances of |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. true if this map contains a mapping for the specified
key.
|
| public boolean | containsValue(Object
value whose presence in this map is to be tested val)Implements java. true if this map maps one or more keys to the
specified value.
|
| public Map. | |
| public Set | entrySet()
Implements java. Set view of the mappings contained in this map.
|
| public void | forEach(BiConsumer<? super K, ? super V>
the operation to apply to each element action)Overrides default java. forEach(BiConsumer) to provide a more efficient implementation
|
| public V | get(Object
the key whose associated value is to be returned key)Implements java. null if this map contains no mapping for the key.
|
| public static <K, V> IdentityMap | Returns: The mapThe size of the map to create size)Return a new instance of this class, with iteration order defined as the order in which entries were added |
| public boolean | |
| public Iterator | |
| public Set | |
| public static <K, V> void | |
| public V | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Implements java. |
| public void | putAll(Map<? extends K, ? extends V>
mappings to be stored in this map otherMap)Implements java. |
| public V | remove(Object
key whose mapping is to be removed from the map key)Implements java. |
| public int | |
| public String | |
| public Collection | values()
Implements java. Collection view of the values contained in this map.
|
| entryArray | back to summary |
|---|---|
| private transient Map. | |
| map | back to summary |
|---|---|
| private final LinkedHashMap<IdentityMap. | |
| IdentityMap | back to summary |
|---|---|
| private IdentityMap(LinkedHashMap<IdentityMap. Private ctor used in serialization.
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| concurrentEntries | back to summary |
|---|---|
| public static <K, V> Map. Return the map entries (as instances of | |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Implements java. Doc from java. Returns
| |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object val) Implements java. Doc from java. Returns | |
| entryArray | back to summary |
|---|---|
public Map.
| |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| forEach | back to summary |
|---|---|
| public void forEach(BiConsumer<? super K, ? super V> action) Overrides default java. Override Map
| |
| get | back to summary |
|---|---|
| public V get(Object key) Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |
| instantiateSequenced | back to summary |
|---|---|
| public static <K, V> IdentityMap Return a new instance of this class, with iteration order defined as the order in which entries were added
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| keyIterator | back to summary |
|---|---|
| public Iterator | |
| keySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| onEachKey | back to summary |
|---|---|
| public static <K, V> void onEachKey(Map<K, V> map, Consumer<K> consumer) | |
| put | back to summary |
|---|---|
| public V put(K key, V value) Implements java. Doc from java. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| putAll | back to summary |
|---|---|
| public void putAll(Map<? extends K, ? extends V> otherMap) Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling | |
| remove | back to summary |
|---|---|
| public V remove(Object key) Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns.
| |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| values | back to summary |
|---|---|
| public Collection Implements java. Doc from java. Returns a
| |
System#identityHashCode(Object)
| Modifier and Type | Field and Description |
|---|---|
| private final K |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public int | |
| public String |
| key | back to summary |
|---|---|
| private final K key | |
| IdentityKey | back to summary |
|---|---|
| pack-priv IdentityKey(K key) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public K | |
| public V | |
| public V | setValue(final V
new value to be stored in this entry value)Implements java. |
| IdentityMapEntry | back to summary |
|---|---|
| pack-priv IdentityMapEntry(final K key, final V value) | |
| getKey | back to summary |
|---|---|
| public K getKey() Implements java. Doc from java. Returns the key corresponding to this entry.
| |
| getValue | back to summary |
|---|---|
| public V getValue() Implements java. Doc from java. Returns the value corresponding to this entry. If the mapping
has been removed from the backing map (by the iterator's
| |
| setValue | back to summary |
|---|---|
| public V setValue(final V value) Implements java. Doc from java. Replaces the value corresponding to this entry with the specified
value (optional operation). (Writes through to the map.) The
behavior of this call is undefined if the mapping has already been
removed from the map (by the iterator's
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Iterator |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public K | |
| public void | remove()
Overrides default java. |
| identityKeyIterator | back to summary |
|---|---|
| private final Iterator<IdentityMap. | |
| KeyIterator | back to summary |
|---|---|
| private KeyIterator(Iterator<IdentityMap. | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public K next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |