Class HashMultiValMap<K,V>

    • Constructor Summary

      Constructors

      Constructor and Description
      HashMultiValMap()
       
    • Method Summary

      Modifier and Type Method and Description
      boolean containsKey(K key)
      Find out whether the given key has any values associated.
      Collection<V> get(K key)
      Retrieve a collection of values associated with key.
      Collection<K> keys()
      Get a collection of associated keys.
      void put(K key, Collection<V> vs)
      Associate all value with this key.
      void put(K key, V value)
      Associate value with key.
      void remove(K key, Collection<V> vs)
      Remove all given values from the key.
      void remove(K key, V value)
      Remove this value from the key.
      void removeAll(K key)
      Remove all values associated with this key.
      int size()
      Get the number of keys in this map.
    • Constructor Detail

      • HashMultiValMap

        public HashMultiValMap()
    • Method Detail

      • containsKey

        public boolean containsKey(K key)
        Description copied from interface: MultiValMap
        Find out whether the given key has any values associated.
        Specified by:
        containsKey in interface  MultiValMap<K,V>
        Parameters:
        key - the key to look up.
        Returns:
        true if this key exists.
      • get

        public Collection<V> get(K key)
        Description copied from interface: MultiValMap
        Retrieve a collection of values associated with key.
        Specified by:
        get in interface  MultiValMap<K,V>
        Parameters:
        key - the key to look up.
        Returns:
        a collection of associated values.
      • put

        public void put(K key,
                        V value)
        Description copied from interface: MultiValMap
        Associate value with key.
        Specified by:
        put in interface  MultiValMap<K,V>
        Parameters:
        key - the key to add.
        value - the associated value.
      • put

        public void put(K key,
                        Collection<V> vs)
        Description copied from interface: MultiValMap
        Associate all value with this key.
        Specified by:
        put in interface  MultiValMap<K,V>
        Parameters:
        key - a key.
        vs - associated values.
      • remove

        public void remove(K key,
                           V value)
        Description copied from interface: MultiValMap
        Remove this value from the key.
        Specified by:
        remove in interface  MultiValMap<K,V>
        Parameters:
        key - the key to remove the value from.
        value - the value to remove.
      • remove

        public void remove(K key,
                           Collection<V> vs)
        Description copied from interface: MultiValMap
        Remove all given values from the key.
        Specified by:
        remove in interface  MultiValMap<K,V>
        Parameters:
        key - the key to remove values from.
        vs - the value to remove.
      • removeAll

        public void removeAll(K key)
        Description copied from interface: MultiValMap
        Remove all values associated with this key.
        Specified by:
        removeAll in interface  MultiValMap<K,V>
        Parameters:
        key - the key to remove all values from.
      • keys

        public Collection<K> keys()
        Description copied from interface: MultiValMap
        Get a collection of associated keys.
        Specified by:
        keys in interface  MultiValMap<K,V>
        Returns:
        the collection of keys registred.
      • size

        public int size()
        Description copied from interface: MultiValMap
        Get the number of keys in this map.
        Specified by:
        size in interface  MultiValMap<K,V>
        Returns:
        the number of keys.