Top Description Methods
org.apache.commons.collections4

public Interface SetValuedMap<K, V>

extends MultiValuedMap<K, V>
Known Direct Implementers
org.apache.commons.collections4.multimap.AbstractSetValuedMap
Type Parameters
<K>
the type of the keys in this map
<V>
the type of the values in this map
Imports
java.util.Set

Defines a map that holds a set of values against each key.

A SetValuedMap is a Map with slightly different semantics:

Since
4.1

Method Summary

Modifier and TypeMethod and Description
public Set<V>

Returns:

the Set of values, implementations should return an empty Set for no mapping
get
(K
the key to retrieve
key
)

Redeclares org.apache.commons.collections4.MultiValuedMap.get.

Gets the set of values associated with the specified key.
public Set<V>

Returns:

the Set of values removed, implementations should return null for no mapping found, but may return an empty collection
remove
(Object
the key to remove values from
key
)

Redeclares org.apache.commons.collections4.MultiValuedMap.remove.

Removes all values associated with the specified key.
Inherited from org.apache.commons.collections4.MultiValuedMap:
asMapclearcontainsKeycontainsMappingcontainsValueentriesisEmptykeyskeySetmapIteratorputputAllputAllputAllremoveMappingsizevalues

Method Detail

getback to summary
public Set<V> get(K key)

Redeclares org.apache.commons.collections4.MultiValuedMap.get.

Gets the set of values associated with the specified key.

Implementations typically return an empty Set if no values have been mapped to the key.

Parameters
key:K

the key to retrieve

Returns:Set<V>

the Set of values, implementations should return an empty Set for no mapping

Annotations
@Override
Exceptions
NullPointerException:
if the key is null and null keys are invalid
removeback to summary
public Set<V> remove(Object key)

Redeclares org.apache.commons.collections4.MultiValuedMap.remove.

Removes all values associated with the specified 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.

Parameters
key:Object

the key to remove values from

Returns:Set<V>

the Set of values removed, implementations should return null for no mapping found, but may return an empty collection

Annotations
@Override
Exceptions
UnsupportedOperationException:
if the map is unmodifiable
NullPointerException:
if the key is null and null keys are invalid