Package: org.codehaus.groovy.util

## [Java] Class ListHashMap<K, V>

- org.codehaus.groovy.util.ListHashMap

- All Implemented Interfaces and Traits:
    Map

      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 Summary

    Constructors
    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.

  - ### Methods Summary

    Methods
    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}

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public ListHashMap()

      Creates a map that keeps up to three entries in array-backed storage.

    - #### public ListHashMap(int listSize)

      Creates a map that keeps up to `listSize` entries in array-backed storage.

      Parameters:
        `listSize` - the number of entries to keep in arrays before promoting to a backing map

  - ### Method Detail

    - #### 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}