Class ArrayHashMap<K,V>

java.lang.Object
com.landawn.abacus.util.ArrayHashMap<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Map<K,V>
Direct Known Subclasses:
LinkedArrayHashMap

public sealed class ArrayHashMap<K,V> extends Object implements Map<K,V> permits LinkedArrayHashMap<K,V>
It's designed to supported primitive/object array key. The elements in the array must not be modified after the array is put into the map as key.
Since:
0.8
Author:
Haiyang Li
  • Constructor Details

    • ArrayHashMap

      public ArrayHashMap()
    • ArrayHashMap

      public ArrayHashMap(int initialCapacity)
      Parameters:
      initialCapacity -
    • ArrayHashMap

      public ArrayHashMap(Class<? extends Map> mapType)
      Parameters:
      mapType -
    • ArrayHashMap

      public ArrayHashMap(Map<? extends K,? extends V> m)
      Parameters:
      m -
  • Method Details

    • get

      public V get(Object key)
      Specified by:
      get in interface Map<K,V>
      Parameters:
      key -
      Returns:
    • put

      public V put(K key, V value)
      Specified by:
      put in interface Map<K,V>
      Parameters:
      key -
      value -
      Returns:
    • putAll

      public final void putAll(Map<? extends K,? extends V> m)
      Specified by:
      putAll in interface Map<K,V>
      Parameters:
      m -
    • remove

      public V remove(Object key)
      Specified by:
      remove in interface Map<K,V>
      Parameters:
      key -
      Returns:
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<K,V>
      Parameters:
      key -
      Returns:
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<K,V>
      Parameters:
      value -
      Returns:
    • keySet

      public Set<K> keySet()
      Specified by:
      keySet in interface Map<K,V>
      Returns:
    • values

      public Collection<V> values()
      Specified by:
      values in interface Map<K,V>
      Returns:
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()
      Specified by:
      entrySet in interface Map<K,V>
      Returns:
    • size

      public int size()
      Specified by:
      size in interface Map<K,V>
      Returns:
    • isEmpty

      public boolean isEmpty()
      Checks if is empty.
      Specified by:
      isEmpty in interface Map<K,V>
      Returns:
      true, if is empty
    • clear

      public void clear()
      Clear.
      Specified by:
      clear in interface Map<K,V>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<K,V>
      Overrides:
      hashCode in class Object
      Returns:
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Map<K,V>
      Overrides:
      equals in class Object
      Parameters:
      obj -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns: