Module org.hsqldb

Class HashMap<K,​V>

  • All Implemented Interfaces:
    Map<K,​V>
    Direct Known Subclasses:
    OrderedHashMap

    public class HashMap<K,​V>
    extends org.hsqldb.map.BaseHashMap
    implements Map<K,​V>
    This class does not store null keys.
    Since:
    1.7.2
    Author:
    Fred Toussi (fredt@users dot sourceforge.net)
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.hsqldb.lib.Map

        Map.Entry<K,​V>
    • Field Summary

      • Fields inherited from class org.hsqldb.map.BaseHashMap

        ACCESS_MAX, emptyObjectArray
    • Constructor Detail

      • HashMap

        public HashMap()
      • HashMap

        public HashMap​(int initialCapacity)
                throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • HashMap

        public HashMap​(int initialCapacity,
                       ObjectComparator<K> comparator)
                throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface Map<K,​V>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface Map<K,​V>
      • get

        public V get​(java.lang.Object key)
        Specified by:
        get in interface Map<K,​V>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface Map<K,​V>
      • remove

        public V remove​(java.lang.Object key)
        Specified by:
        remove in interface Map<K,​V>
      • remove

        public boolean remove​(K key,
                              V value)
        Removes the spacific key, value pair.
        Parameters:
        key - the key
        value - the value
        Returns:
        the value associated with the key, or null if none
      • putAll

        public void putAll​(Map<K,​V> m)
      • keysToArray

        public <T> T[] keysToArray​(T[] array)
      • valuesToArray

        public <T> T[] valuesToArray​(T[] array)
      • keySet

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