Class MultiValuedMap<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this map
    V - the type of mapped values
    All Implemented Interfaces:
    Serializable, Cloneable, Map<K,​List<V>>

    public class MultiValuedMap<K,​V>
    extends HashMap<K,​List<V>>
    A Map of key-value pairs where a key can contain multiple values.
    See Also:
    Serialized Form
    • Constructor Detail

      • MultiValuedMap

        public MultiValuedMap()
    • Method Detail

      • putSingle

        public List<V> putSingle​(K key,
                                 V value)
        Add the provided value to the list of values associated with this key.
        Parameters:
        key - the key
        value - the new (additional) value belonging to this key.
        Returns:
        the list associated with this key
      • putMap

        public void putMap​(Map<K,​V> map)
        Copies all of the mappings from the specified map into this map.
        Parameters:
        map - mappings to be stored in this map