K
- the type of the keys in this mapV
- the type of the values in this mappublic interface SetValuedMap<K,V> extends MultiValuedMap<K,V>
A SetValuedMap
is a Map with slightly different semantics:
Modifier and Type | Method and Description |
---|---|
Set<V> |
get(K key)
Gets the set of values associated with the specified key.
|
Set<V> |
remove(Object key)
Removes all values associated with the specified key.
|
asMap, clear, containsKey, containsMapping, containsValue, entries, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, size, values
Set<V> get(K key)
Implementations typically return an empty Set
if no values
have been mapped to the key.
get
in interface MultiValuedMap<K,V>
key
- the key to retrieveSet
of values, implementations should return an
empty Set
for no mappingNullPointerException
- if the key is null and null keys are invalidSet<V> remove(Object key)
The returned set may be modifiable, but updates will not be propagated to this set-valued map. In case no mapping was stored for the specified key, an empty, unmodifiable set will be returned.
remove
in interface MultiValuedMap<K,V>
key
- the key to remove values fromSet
of values removed, implementations should
return null for no mapping found, but may return an empty collectionUnsupportedOperationException
- if the map is unmodifiableNullPointerException
- if the key is null and null keys are invalidCopyright © 2001–2019 The Apache Software Foundation. All rights reserved.