Class MultiMap<K,​V>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<K,​java.util.Set<V>>

    public class MultiMap<K,​V>
    extends java.util.HashMap<K,​java.util.Set<V>>
    Maps keys to multiple values. Each key value pair is unique.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean putSingle​(K key, V value)
      Associate a key with a new value.
      boolean removeSingle​(K key, V value)
      Disassociate a key with a value.
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Constructor Detail

      • MultiMap

        public MultiMap()
    • Method Detail

      • putSingle

        public boolean putSingle​(K key,
                                 V value)
        Associate a key with a new value.
        Parameters:
        key - to associate with
        value - will be associated
        Returns:
        whether the value was not yet associated with the key
      • removeSingle

        public boolean removeSingle​(K key,
                                    V value)
        Disassociate a key with a value.
        Parameters:
        key - to disassociate from
        value - will be disassociated
        Returns:
        whether the value was associated with the key