public class ListHashMap<K, V>
extends Object
implements Map
Represents a 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()Creates a map that keeps up to three entries in array-backed storage. |
ListHashMap(int listSize)Creates a map that keeps up to listSize entries in array-backed storage. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
clear(){@inheritDoc} |
|
public boolean |
containsKey(Object key){@inheritDoc} |
|
public boolean |
containsValue(Object value){@inheritDoc} |
|
public Set<Entry<K, V>> |
entrySet(){@inheritDoc} |
|
public V |
get(Object key){@inheritDoc} |
|
public boolean |
isEmpty(){@inheritDoc} |
|
public Set<K> |
keySet(){@inheritDoc} |
|
public V |
put(K key, V value){@inheritDoc} |
|
public void |
putAll(Map<? extends K, ? extends V> m){@inheritDoc} |
|
public V |
remove(Object key){@inheritDoc} |
|
public int |
size(){@inheritDoc} |
|
public Collection<V> |
values(){@inheritDoc} |
Creates a map that keeps up to three entries in array-backed storage.
Creates a map that keeps up to listSize entries in array-backed storage.
listSize - the number of entries to keep in arrays before promoting to a backing map{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.