Package jmri.jmrit.logixng.util
Class DuplicateKeyMap<K,V>
- java.lang.Object
-
- jmri.jmrit.logixng.util.DuplicateKeyMap<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
public class DuplicateKeyMap<K,V> extends java.lang.Object implements java.util.Map<K,V>
A map that may contain multiple items with same key
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<K,java.util.List<V>>
_internalMap
-
Constructor Summary
Constructors Constructor Description DuplicateKeyMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
V
get(java.lang.Object key)
java.util.List<V>
getAll(K key)
Get all items in the map that has the key 'key'boolean
isEmpty()
java.util.Set<K>
keySet()
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> m)
V
remove(java.lang.Object key)
boolean
remove(java.lang.Object key, java.lang.Object value)
void
removeValue(K key, V value)
Remove a value.int
size()
java.util.Collection<V>
values()
-
-
-
Field Detail
-
_internalMap
java.util.Map<K,java.util.List<V>> _internalMap
-
-
Constructor Detail
-
DuplicateKeyMap
public DuplicateKeyMap()
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
getAll
public java.util.List<V> getAll(K key)
Get all items in the map that has the key 'key'- Parameters:
key
- the key whose associated values is to be returned- Returns:
- an unmodifiable list of all the items
-
remove
public boolean remove(java.lang.Object key, java.lang.Object value)
-
removeValue
public void removeValue(K key, V value)
Remove a value.- Parameters:
key
- the keyvalue
- the value
-
-