Package com.atlassian.jira.util.collect
Interface MultiMap<K,V,C extends Collection<V>>
- All Superinterfaces:
Map<K,C>
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet all elements in all Collections.booleanDoes thisMultiMapcontain the value in any of its value collections.booleancontainsValue(Collection<?> value) Does thisMultiMapcontain the Collection as any of its value collections.voidcopyTo(Collection<V> collection) Copy all values to the supplied collection.booleanPut a single value in to the appropriate mapped collection.intsizeAll()The sum of sizes of all contained keys.Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Method Details
-
allValues
C allValues()Get all elements in all Collections. This returns the same type as the mapped Collections, so if thisMultiMapcontainsliststhen there will be the same number of elements assizeAll(), whereas if theMultiMapcontainssetsthen duplicates may be removed. If a different type of CollectionThe returned Collection is immutable.
- Returns:
- a Collection
-
sizeAll
int sizeAll()The sum of sizes of all contained keys. May be different to callingMap.size()on the result ofallValues()- Returns:
- the total number of elements in all mapped collections.
-
putSingle
Put a single value in to the appropriate mapped collection.- Parameters:
key- the Keyvalue- the single value to add to the collection for this key- Returns:
- whether the Collection was modified.
-
contains
Does thisMultiMapcontain the value in any of its value collections.- Parameters:
value- the single value to check for- Returns:
- true if the value is contained in any of the mapped collections
-
containsValue
Does thisMultiMapcontain the Collection as any of its value collections.- Parameters:
value- the collection to check for- Returns:
- true if the value is contained in any of the mapped collections
-
copyTo
Copy all values to the supplied collection.- Parameters:
collection- to copy all the values to.
-