K
- The type of the map keysV
- The type of the map valuespublic class LinearMap<K,V> extends AbstractMap<K,V>
Map
that performs very well for a SMALL number of entries. null
keys and null
values are
supported.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LinearMap() |
LinearMap(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
protected boolean |
keysEqual(Object key1,
Object key2) |
V |
put(K key,
V value) |
V |
remove(Object key) |
int |
size() |
protected boolean |
valuesEqual(Object value1,
Object value2) |
clone, equals, hashCode, keySet, putAll, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public int size()
public boolean isEmpty()
public boolean containsKey(@Nullable Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public boolean containsValue(@Nullable Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public void clear()
protected boolean keysEqual(@Nullable Object key1, @Nullable Object key2)
IdentityHashMap
Copyright © 2018 Arno Unkrig. All rights reserved.