Class CmsManyToOneMap<K,​V>

  • Type Parameters:
    K - the key type
    V - the value type

    public class CmsManyToOneMap<K,​V>
    extends java.lang.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.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V get​(K key)
      Gets the value for a key.
      void put​(K key, V value)
      Associates a value with a key.
      void remove​(K key)
      Removes the entry with the given key.
      void removeValue​(V value)
      Removes all entries with the given value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CmsManyToOneMap

        public CmsManyToOneMap​(CmsManyToOneMap<K,​V> other)
        Creates a new instance by copying the data from another one.

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

      • 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