Class MultiMap<K,​V>

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    SetBasedMultiMap

    public class MultiMap<K,​V>
    extends Object
    implements Serializable
    Map from key to multiple values By default the collection (which is stored as a value in the map) is java.util.List-based. Thus the order is preserved
    See Also:
    Serialized Form
    • Field Detail

      • EMPTY

        public static final MultiMap EMPTY
    • Constructor Detail

      • MultiMap

        public MultiMap()
      • MultiMap

        public MultiMap​(int i,
                        float v)
    • Method Detail

      • createMap

        protected Map<K,​Collection<V>> createMap​(int i,
                                                       float v)
      • createCollection

        protected Collection<V> createCollection()
      • createEmptyCollection

        protected Collection<V> createEmptyCollection()
      • putAllValues

        public <Kk extends K,​Vv extends V> void putAllValues​(MultiMap<Kk,​Vv> from)
      • putValues

        public void putValues​(K key,
                              Collection<? extends V> values)
      • putValue

        public void putValue​(K key,
                             V value)
      • isEmpty

        public boolean isEmpty()
      • containsKey

        public boolean containsKey​(K key)
      • containsScalarValue

        public boolean containsScalarValue​(V value)
      • keySet

        public Set<K> keySet()
      • size

        public int size()
      • removeValue

        public void removeValue​(K key,
                                V value)
      • clear

        public void clear()
      • emptyInstance

        @NotNull
        public static <K,​V> MultiMap<K,​V> emptyInstance()
      • create

        @NotNull
        public static <K,​V> MultiMap<K,​V> create​(int i,
                                                             float v)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object