IdentityHashMap implementation that maintains predictable iteration order,
with special care for keys iteration efficiency, and uses reference equality
(i.e. ==) in place of object-equality when comparing keys.
Note that the keySet(), values() and entrySet() methods for this class
return unmodifiable collections and are only meant for iteration.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final LinkedIdentityHashMap. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Overrides java. Implements java. |
| public Object | clone()
Overrides java. |
| public Set | entrySet()
Overrides java. Implements java. Set view of the mappings contained in this map.
|
| public Set | keySet()
Overrides java. Implements java. |
| public V | put(K
the key with which the specified value is to be associated key, V the value to be associated with the specified key value)Overrides java. Implements java. |
| public V | remove(Object
key whose mapping is to be removed from the map key)Overrides java. Implements java. |
| public boolean | remove(Object
key with which the specified value is associated key, Object value expected to be associated with the specified key value)Overrides java. Overrides default java. |
| public Collection | values()
Overrides java. Implements java. Collection view of the values contained in this map.
|
| orderedKeys | back to summary |
|---|---|
| private final LinkedIdentityHashMap. | |
| LinkedIdentityHashMap | back to summary |
|---|---|
| public LinkedIdentityHashMap() | |
| clear | back to summary |
|---|---|
| public void clear() Overrides java. Implements java. Doc from java. Removes all of the mappings from this map. The map will be empty after this call returns.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Returns a shallow copy of this identity hash map: the keys and values themselves are not cloned. | |
| entrySet | back to summary |
|---|---|
| public Set Overrides java. Implements java. Doc from java. Returns a Like the backing map, the Owing to the reference-equality-based semantics of the
| |
| keySet | back to summary |
|---|---|
| public Set Overrides java. Implements java. Doc from java. Returns an identity-based set view of the keys contained in this map.
The set is backed by the map, so changes to the map are reflected in
the set, and vice-versa. If the map is modified while an iteration
over the set is in progress, the results of the iteration are
undefined. The set supports element removal, which removes the
corresponding mapping from the map, via the While the object returned by this method implements the
The The | |
| put | back to summary |
|---|---|
| public V put(K key, V value) Overrides java. Implements java. Doc from java. Associates the specified value with the specified key in this identity
hash map. If this map already
| |
| remove | back to summary |
|---|---|
| public V remove(Object key) Overrides java. Implements java. Doc from java. Removes the mapping for this key from this map if present.
The mapping is removed if and only if the mapping has a key
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object key, Object value) Overrides java. Overrides default java. Doc from java. Removes the entry for the specified key only if it is currently mapped to the specified value. More formally, if this map contains a mapping from a key
| |
| values | back to summary |
|---|---|
| public Collection Overrides java. Implements java. Doc from java. Returns a While the object returned by this method implements the
| |
| Access | Constructor and Description |
|---|---|
| private |
| ArraySet | back to summary |
|---|---|
| private ArraySet() | |