Interface SetMultimap<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Superinterfaces:
Multimap<K,V>
- All Known Implementing Classes:
HashSetMultimap
A multimap that keeps the values of each key in a set, without duplicates: adding an entry it already contains leaves
it unchanged.
- Since:
- 0.1.2
-
Method Summary
Modifier and TypeMethodDescriptionasMap()Returns a live view of this multimap as a map from each key to its values.entries()Returns a live view of the entries, grouped by key.Returns a live view of the values of a key, empty if the key is absent.Removes all the values of a key.replaceValues(K key, Iterable<? extends V> values) Replaces all the values of a key.
-
Method Details
-
get
-
entries
-
asMap
-
removeAll
Removes all the values of a key.- Specified by:
removeAllin interfaceMultimap<K,V> - Parameters:
key- the key- Returns:
- the values removed, in an unmodifiable set, empty if the key was absent
- Throws:
UnsupportedOperationException- if this multimap is unmodifiable
-
replaceValues
Replaces all the values of a key. Replacing them with no values removes the key.- Specified by:
replaceValuesin interfaceMultimap<K,V> - Parameters:
key- the keyvalues- the new values ofkey- Returns:
- the values replaced, in an unmodifiable set, empty if the key was absent
- Throws:
UnsupportedOperationException- if this multimap is unmodifiable
-