Class DelegatingMultimap<K,​V>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<K,​java.util.Collection<V>> map  
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      DelegatingMultimap​(java.util.Map<K,​java.util.Collection<V>> map)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clears the multimap
      protected java.util.Collection<V> createValueCollection()  
      java.util.Collection<java.util.Map.Entry<K,​java.util.Collection<V>>> entrySet()
      Get all associations of the multimap.
      boolean equals​(java.lang.Object o)  
      java.util.Collection<V> get​(K key)
      Get all values associated with the key
      int hashCode()  
      boolean isEmpty()
      Checks if multimap is empty
      java.util.Collection<K> keys()
      Keys in the map
      void merge​(Multimap<K,​V> other)  
      void put​(K key, V value)
      Put the element pair.
      void putAll​(K key, java.util.Collection<V> vvs)
      Put multiple pairs.
      void remove​(K key)  
      java.lang.String toString()  
      java.util.Collection<V> values()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • map

        protected final java.util.Map<K,​java.util.Collection<V>> map
    • Constructor Detail

      • DelegatingMultimap

        public DelegatingMultimap​(java.util.Map<K,​java.util.Collection<V>> map)
    • Method Detail

      • createValueCollection

        protected java.util.Collection<V> createValueCollection()
      • put

        public void put​(K key,
                        V value)
        Description copied from interface: Multimap
        Put the element pair.
        Specified by:
        put in interface Multimap<K,​V>
        Parameters:
        key - key
        value - value
      • putAll

        public void putAll​(K key,
                           java.util.Collection<V> vvs)
        Description copied from interface: Multimap
        Put multiple pairs.
        Specified by:
        putAll in interface Multimap<K,​V>
        Parameters:
        key - key
        vvs - values
      • get

        public java.util.Collection<V> get​(K key)
        Description copied from interface: Multimap
        Get all values associated with the key
        Specified by:
        get in interface Multimap<K,​V>
        Parameters:
        key - key
        Returns:
        collection of values
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: Multimap
        Checks if multimap is empty
        Specified by:
        isEmpty in interface Multimap<K,​V>
        Returns:
        true, if empty
      • clear

        public void clear()
        Description copied from interface: Multimap
        Clears the multimap
        Specified by:
        clear in interface Multimap<K,​V>
      • keys

        public java.util.Collection<K> keys()
        Description copied from interface: Multimap
        Keys in the map
        Specified by:
        keys in interface Multimap<K,​V>
        Returns:
        collection of keys
      • values

        public java.util.Collection<V> values()
        Specified by:
        values in interface Multimap<K,​V>
      • entrySet

        public java.util.Collection<java.util.Map.Entry<K,​java.util.Collection<V>>> entrySet()
        Description copied from interface: Multimap
        Get all associations of the multimap. The method is intended for read-only view.
        Specified by:
        entrySet in interface Multimap<K,​V>
        Returns:
        entry set of the multimap
      • remove

        public void remove​(K key)
        Specified by:
        remove in interface Multimap<K,​V>
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object