de.unkrig.commons.util.collections
Class IdentityLinearMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
de.unkrig.commons.util.collections.LinearMap<K,V>
de.unkrig.commons.util.collections.IdentityLinearMap<K,V>
- Type Parameters:
K - The type of the map keysV - The type of the map values
- All Implemented Interfaces:
- java.util.Map<K,V>
public final class IdentityLinearMap<K,V>
- extends LinearMap<K,V>
An identity map (see IdentityHashMap) that performs very well for a SMALL number of entries.
| Nested classes/interfaces inherited from class java.util.AbstractMap |
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
|
Method Summary |
protected boolean |
keysEqual(java.lang.Object key1,
java.lang.Object key2)
|
protected boolean |
valuesEqual(java.lang.Object value1,
java.lang.Object value2)
|
| Methods inherited from class java.util.AbstractMap |
clone, equals, hashCode, keySet, putAll, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
IdentityLinearMap
public IdentityLinearMap()
keysEqual
protected boolean keysEqual(@Nullable
java.lang.Object key1,
@Nullable
java.lang.Object key2)
- Overrides:
keysEqual in class LinearMap<K,V>
- Returns:
- Whether the two keys are equal in the sense of this map; can be overridden e.g. for an 'identity map'
- See Also:
IdentityHashMap
valuesEqual
protected boolean valuesEqual(@Nullable
java.lang.Object value1,
@Nullable
java.lang.Object value2)
- Overrides:
valuesEqual in class LinearMap<K,V>
- Returns:
- Whether the two values are equal in the sense of this map