Class MultiMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,Set<V>>
org.apache.wayang.core.util.MultiMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,Set<V>>

public class MultiMap<K,V> extends HashMap<K,Set<V>>
Maps keys to multiple values. Each key value pair is unique.
See Also:
  • Constructor Details

    • MultiMap

      public MultiMap()
  • Method Details

    • putSingle

      public boolean putSingle(K key, V value)
      Associate a key with a new value.
      Parameters:
      key - to associate with
      value - will be associated
      Returns:
      whether the value was not yet associated with the key
    • removeSingle

      public boolean removeSingle(K key, V value)
      Disassociate a key with a value.
      Parameters:
      key - to disassociate from
      value - will be disassociated
      Returns:
      whether the value was associated with the key