Class ListMap<K,​V>


  • public class ListMap<K,​V>
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<K,​java.util.List<V>> map  
    • Constructor Summary

      Constructors 
      Constructor Description
      ListMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      boolean containsKey​(K key)  
      boolean containsMapping​(K key, V value)  
      java.util.List<V> get​(K key)
      Overridden to return empty list instead of null
      java.util.Set<K> keySet()  
      java.lang.Object put​(K key, V value)  
      void putAll​(ListMap listMap)  
      void putAll​(java.util.Map map)  
      void putAll​(K key, java.util.Collection<V> values)  
      java.util.List<V> remove​(K key)  
      void remove​(K key, V value)
      Removes the value from the list if thhe list exists
      int size()  
      java.util.Collection<V> values()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • map

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

      • ListMap

        public ListMap()
    • Method Detail

      • size

        public int size()
      • clear

        public void clear()
      • containsKey

        public boolean containsKey​(K key)
      • containsMapping

        public boolean containsMapping​(K key,
                                       V value)
      • putAll

        public void putAll​(java.util.Map map)
      • putAll

        public void putAll​(ListMap listMap)
      • putAll

        public void putAll​(K key,
                           java.util.Collection<V> values)
      • put

        public java.lang.Object put​(K key,
                                    V value)
      • keySet

        public java.util.Set<K> keySet()
      • values

        public java.util.Collection<V> values()
      • remove

        public java.util.List<V> remove​(K key)
      • remove

        public void remove​(K key,
                           V value)
        Removes the value from the list if thhe list exists
        Parameters:
        key -
        value -
      • get

        public java.util.List<V> get​(K key)
        Overridden to return empty list instead of null