Class MultiMap<K,V>

java.lang.Object
java.util.AbstractMap<K,List<V>>
java.util.HashMap<K,List<V>>
io.github.syst3ms.skriptparser.util.MultiMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,List<V>>

public class MultiMap<K,V> extends HashMap<K,List<V>>
A simple implementation of a Multimap, emulating Guava's. This implementation allows duplicate elements in the values.
See Also:
  • Constructor Details

    • MultiMap

      public MultiMap()
  • Method Details

    • putOne

      public void putOne(@Nullable K key, @Nullable V value)
      Looks for a list that is mapped to the given key. If there is one, then the given value is added to that list. If there isn't, then a new entry is created and has the value added to it.
      Parameters:
      key - the key
      value - the value
    • getAllValues

      public List<V> getAllValues()
      Returns:
      all values of all keys of this MultiMap