K
- the type of the keys in this mapV
- the type of the values in this mappublic interface ListValuedMap<K,V> extends MultiValuedMap<K,V>
A ListValuedMap
is a Map with slightly different semantics:
Modifier and Type | Method and Description |
---|---|
List<V> |
get(K key)
Gets the list of values associated with the specified key.
|
List<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
List<V> get(K key)
This method will return an empty list if
MultiValuedMap.containsKey(Object)
returns false
. Changes to the
returned list will update the underlying ListValuedMap
and
vice-versa.
get
in interface MultiValuedMap<K,V>
key
- the key to retrieveList
of values, implementations should return an
empty List
for no mappingNullPointerException
- if the key is null and null keys are invalidList<V> remove(Object key)
The returned list may be modifiable, but updates will not be propagated to this list-valued map. In case no mapping was stored for the specified key, an empty, unmodifiable list will be returned.
remove
in interface MultiValuedMap<K,V>
key
- the key to remove values fromList
of values removed, implementations
typically return an empty, unmodifiable List
for no mapping foundUnsupportedOperationException
- if the map is unmodifiableNullPointerException
- if the key is null and null keys are invalidCopyright © 2001–2018 The Apache Software Foundation. All rights reserved.