Class MultiMap<K,​V>

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

    public class MultiMap<K,​V>
    extends java.util.HashMap<K,​java.util.List<V>>
    implements java.util.Map<K,​java.util.List<V>>
    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()  
      MultiMap​(boolean noduplicates)  
      MultiMap​(MultiMap<S,​T> other)  
      MultiMap​(java.lang.Class<K> keyClass, java.lang.Class<V> valueClass, boolean noduplicates)  
      MultiMap​(java.util.Map<S,​? extends java.util.List<T>> other)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(K key, V value)  
      boolean addAll​(java.util.Map<K,​? extends java.util.Collection<? extends V>> map)  
      boolean addAll​(K key, java.util.Collection<? extends V> value)  
      java.util.Iterator<V> all()  
      java.util.List<V> allValues()
      Return a collection with all values
      java.util.Map<K,​V> flatten()  
      java.util.Iterator<V> iterate​(K key)  
      boolean removeAll​(K key, java.util.Collection<? extends V> value)  
      boolean removeValue​(K key, V value)  
      MultiMap<V,​K> transpose()  
      • 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

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • Constructor Detail

      • MultiMap

        public MultiMap()
      • MultiMap

        public MultiMap​(boolean noduplicates)
      • MultiMap

        public MultiMap​(java.lang.Class<K> keyClass,
                        java.lang.Class<V> valueClass,
                        boolean noduplicates)
      • MultiMap

        public MultiMap​(java.util.Map<S,​? extends java.util.List<T>> other)
      • MultiMap

        public MultiMap​(MultiMap<S,​T> other)
    • Method Detail

      • add

        public boolean add​(K key,
                           V value)
      • addAll

        public boolean addAll​(K key,
                              java.util.Collection<? extends V> value)
      • addAll

        public boolean addAll​(java.util.Map<K,​? extends java.util.Collection<? extends V>> map)
      • removeValue

        public boolean removeValue​(K key,
                                   V value)
      • removeAll

        public boolean removeAll​(K key,
                                 java.util.Collection<? extends V> value)
      • iterate

        public java.util.Iterator<V> iterate​(K key)
      • all

        public java.util.Iterator<V> all()
      • flatten

        public java.util.Map<K,​V> flatten()
      • allValues

        public java.util.List<V> allValues()
        Return a collection with all values
        Returns:
        all values