K
- the type of the key elementsV
- the type of the value elementspublic final class LinkedIdentityMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
LinkedIdentityMap
is implemented by IdentityHashMap and takes
advantage of LinkedList to keep the key elements ordered by their insertion
sequence. Unlike IdentityHashMap, LinkedIdentityMap
only compares its
keys by identities NOT the values.Modifier and Type | Class and Description |
---|---|
(package private) static class |
LinkedIdentityMap.EntrySet<S,U>
LinkedIdentityMap::EntrySet is designed to build a Set view of the
LinkedIdentityMap#entrySet.
|
(package private) static class |
LinkedIdentityMap.IdentityEntry<S,U>
LinkedIdentityMap::IdentityEntry overrides the equals().
|
(package private) static class |
LinkedIdentityMap.KeySet<S,U>
LinkedIdentityMap::KeySet is designed to build a Set view of the
LinkedIdentityMap#keySet.
|
(package private) static class |
LinkedIdentityMap.Values<S,U>
LinkedIdentityMap::Values is designed to build a Collection view of the
LinkedIdentityMap#values.
|
Constructor and Description |
---|
LinkedIdentityMap()
Creates a
LinkedIdentityMap . |
LinkedIdentityMap(java.util.Map<? extends K,? extends V> map)
Creates a
LinkedIdentityMap by given Map. |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
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) |
V |
get(java.lang.Object key) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<V> |
values() |
public LinkedIdentityMap()
LinkedIdentityMap
.public LinkedIdentityMap(java.util.Map<? extends K,? extends V> map)
LinkedIdentityMap
by given Map.map
- any Mappublic boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public boolean equals(java.lang.Object o)
public int hashCode()
public java.lang.String toString()
toString
in class java.lang.Object