public class ListHashMap<K,V> extends Object implements Map<K,V>
Map
that is optimized for a small number of
entries. For a number of entries up to listSize
the entries
are stored in arrays. After listSize
entries are exceeded
storage switches internally to a Map
and converts back
to being array based when its size is less than or equal to listSize
.
Null keys or values are not supported.
This class is not thread safe.Constructor and Description |
---|
ListHashMap() |
ListHashMap(int listSize) |
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() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll