Package org.opencms.util
Class CmsManyToOneMap<K,V>
- java.lang.Object
-
- org.opencms.util.CmsManyToOneMap<K,V>
-
- Type Parameters:
K- the key typeV- 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.
-
-
Constructor Summary
Constructors Constructor Description CmsManyToOneMap()Creates a new instance.CmsManyToOneMap(CmsManyToOneMap<K,V> other)Creates a new instance by copying the data from another one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vget(K key)Gets the value for a key.voidput(K key, V value)Associates a value with a key.voidremove(K key)Removes the entry with the given key.voidremoveValue(V value)Removes all entries with the given value.
-
-
-
Constructor Detail
-
CmsManyToOneMap
public CmsManyToOneMap()
Creates a new instance.
-
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 keyvalue- the value
-
removeValue
public void removeValue(V value)
Removes all entries with the given value.- Parameters:
value- the value
-
-