Class MultiMap<K,​V>

    • Constructor Detail

      • MultiMap

        public MultiMap()
        Constructor
        See Also:
        HashMap()
      • MultiMap

        public MultiMap​(int initialCapacity,
                        float loadFactor)
        Constructor
        Parameters:
        initialCapacity -
        loadFactor -
        See Also:
        HashMap(int, float)
      • MultiMap

        public MultiMap​(int initialCapacity)
        Constructor
        Parameters:
        initialCapacity -
        See Also:
        HashMap(int)
      • MultiMap

        public MultiMap​(Map<? extends K,​? extends List<V>> m)
        Constructor
        Parameters:
        m -
        See Also:
        HashMap(Map)
    • Method Detail

      • addValue

        public void addValue​(K key,
                             V value)
        Adds value to the specified key
        Parameters:
        key -
        value -
      • removeValue

        public void removeValue​(K key,
                                V value)
        Removes value from the specified key
        Parameters:
        key -
        value -
      • replaceValues

        public void replaceValues​(K key,
                                  V value)
        Replaces all existing values with the specified value. If no values exist for the key the value will be added.
        Parameters:
        key -
        value -
      • getFirstValue

        public V getFirstValue​(K key)
        Gets the first value in the value list
        Parameters:
        key -
        Returns:
        first value