Class CmsManyToOneMap<K,V>

java.lang.Object
org.opencms.util.CmsManyToOneMap<K,V>
Type Parameters:
K - the key type
V - the value type

public class CmsManyToOneMap<K,V> extends Object
Special collection class which allows lookup from keys to values and from values to sets of keys.

It also implements efficient removal of values, not just keys.

  • Constructor Details

    • CmsManyToOneMap

      public CmsManyToOneMap()
      Creates a new instance.

    • CmsManyToOneMap

      Creates a new instance by copying the data from another one.

      Parameters:
      other - the other map to copy the data from
  • Method Details

    • get

      public V get(K key)
      Gets the value for a key.

      Parameters:
      key - the key
      Returns:
      the value for the key, or null
    • put

      public void put(K key, V value)
      Associates a value with a key.

      Parameters:
      key - the key
      value - the value
    • remove

      public void remove(K key)
      Removes the entry with the given key.

      Parameters:
      key - the key
    • removeValue

      public void removeValue(V value)
      Removes all entries with the given value.

      Parameters:
      value - the value