Class MultiMap<K,V>

java.lang.Object
org.omegat.util.MultiMap<K,V>

public class MultiMap<K,V> extends Object
A map that maps keys to sets of values. Does NOT allow null keys/values.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty MultiMap.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this map contains a mapping for the specified key.
    boolean
    containsPair(K key, V value)
    Returns true if this map maps the specified key to the specified value.
    void
    put(K key, V value)
    Associates the specified value with the specified key in this multi-map.
    void
    Removes all the mappings for this key from this map if it is present.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MultiMap

      public MultiMap()
      Creates an empty MultiMap.
  • Method Details

    • containsKey

      public boolean containsKey(K key)
      Returns true if this map contains a mapping for the specified key.
    • containsPair

      public boolean containsPair(K key, V value)
      Returns true if this map maps the specified key to the specified value.
    • put

      public void put(K key, V value)
      Associates the specified value with the specified key in this multi-map. Unlike normal Map, if the map previously contained a mapping for this key, the new value is appended to the list of the values mapped from this key.
    • remove

      public void remove(Object key)
      Removes all the mappings for this key from this map if it is present.