Class CollectionMap<K,V>
java.lang.Object
com.vividsolutions.jump.util.CollectionMap<K,V>
- All Implemented Interfaces:
Map<K, Collection<V>>
A Map whose values are Collections.
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a CollectionMap.CollectionMap(Class<? extends Map> mapClass) Creates a CollectionMap backed by the given Map class.CollectionMap(Class<? extends Map> mapClass, Class<Collection> collectionClass) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the item to the Collection at the given key, creating a new Collection if necessary.voidaddItems(CollectionMap<K, V> other) voidaddItems(K key, Collection<V> items) Adds the items to the Collection at the given key, creating a new Collection if necessary.voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) Set<Map.Entry<K, Collection<V>>> entrySet()Map<K, ? extends Collection<V>> getMap()booleanisEmpty()keySet()Returns the keys.put(K key, Collection<V> value) voidputAll(Map<? extends K, ? extends Collection<V>> map) voidremoveItem(K key, V item) voidremoveItems(K key, Collection<V> items) intsize()Returns the number of mappings.values()Returns the values.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
CollectionMap
-
CollectionMap
-
CollectionMap
public CollectionMap()Creates a CollectionMap.
-
-
Method Details
-
addItem
-
removeItem
-
clear
-
addItems
Adds the items to the Collection at the given key, creating a new Collection if necessary.- Parameters:
key- the key to the Collection to which the items should be addeditems- the items to add
-
addItems
-
values
Returns the values. -
keySet
-
size
-
get
-
getItems
-
remove
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
entrySet
-
isEmpty
-
put
-
putAll
-
removeItems
-
getMap
-