MultiValuedMap to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| private | UnmodifiableMultiValuedMap(final MultiValuedMap<? extends K, ? extends V>
the MultiValuedMap to decorate, may not be null map)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public Map | asMap()
Overrides org. Implements org. Map from each distinct
key to the non-empty collection of that key's associated values.
|
| public void | clear()
Overrides org. Implements org. |
| public Collection | entries()
Overrides org. Implements org. Collection view of the mappings contained in this multi-valued map.
|
| public Collection | get(final K
the key to retrieve key)Overrides org. Implements org. |
| public MultiSet | keys()
Overrides org. Implements org. MultiSet view of the keys contained in this multi-valued map.
|
| public Set | keySet()
Overrides org. Implements org. Set view of the keys contained in this multi-valued map.
|
| public MapIterator | mapIterator()
Overrides org. Implements org. MapIterator over this multi-valued map.
|
| public boolean | put(final K
the key to store against key, final V the value to add to the collection at the key value)Overrides org. Implements org. |
| public boolean | putAll(final K
the key to store against key, final Iterable<? extends V> the values to add to the collection at the key, may not be null values)Overrides org. Implements org. |
| public boolean | putAll(final Map<? extends K, ? extends V>
mappings to be stored in this map, may not be null map)Overrides org. Implements org. |
| public boolean | putAll(final MultiValuedMap<? extends K, ? extends V>
mappings to be stored in this map, may not be null map)Overrides org. Implements org. |
| public Collection | remove(final Object
the key to remove values from key)Overrides org. Implements org. |
| public boolean | removeMapping(final Object
the key to remove from key, final Object the item to remove item)Overrides org. Implements org. |
| public static < the type of key elements K, the type of value elements V> UnmodifiableMultiValuedMap | Returns: an unmodifiable MultiValuedMapthe map to decorate, may not be null map)Factory method to create an unmodifiable MultiValuedMap. |
| public Collection | values()
Overrides org. Implements org. Collection view of all values contained in this multi-valued map.
|
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| UnmodifiableMultiValuedMap | back to summary |
|---|---|
| private UnmodifiableMultiValuedMap(final MultiValuedMap<? extends K, ? extends V> map) Constructor that wraps (not copies).
| |
| asMap | back to summary |
|---|---|
| public Map Overrides org. Implements org. Doc from org. Returns a view of this multi-valued map as a
Note that
Changes to the returned map or the collections that serve as its values
will update the underlying multi-valued map, and vice versa. The map does
not support
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Implements org. Doc from org. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| entries | back to summary |
|---|---|
| public Collection Overrides org. Implements org. Doc from org. Returns a The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa.
| |
| get | back to summary |
|---|---|
| public Collection Overrides org. Implements org. Doc from org. Returns a view collection of the values associated with the specified key.
This method will return an empty collection if
| |
| keys | back to summary |
|---|---|
| public MultiSet Overrides org. Implements org. Doc from org. Returns a
The This multiset is backed by the map, so any changes in the map are reflected in the multiset. | |
| keySet | back to summary |
|---|---|
| public Set Overrides org. Implements org. Doc from org. Returns a The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.
If the map is modified while an iteration over the set is in
progress (except through the iterator's own | |
| mapIterator | back to summary |
|---|---|
| public MapIterator Overrides org. Implements org. Doc from org. Obtains a
A map iterator is an efficient way of iterating over maps. There is no
need to access the entries collection or use
| |
| put | back to summary |
|---|---|
| public boolean put(final K key, final V value) Overrides org. Implements org. Doc from org. Adds a key-value mapping to this multi-valued map.
Unlike a normal
The method will return
| |
| putAll | back to summary |
|---|---|
| public boolean putAll(final K key, final Iterable<? extends V> values) Overrides org. Implements org. Doc from org. Adds a mapping to the specified key for all values contained in the given Iterable. | |
| putAll | back to summary |
|---|---|
| public boolean putAll(final Map<? extends K, ? extends V> map) Overrides org. Implements org. Doc from org. Copies all mappings from the specified map to this multi-valued map (optional operation).
The effect of this call is equivalent to that of calling
The behavior of this operation is undefined if the specified map is modified while the operation is in progress. | |
| putAll | back to summary |
|---|---|
| public boolean putAll(final MultiValuedMap<? extends K, ? extends V> map) Overrides org. Implements org. Doc from org. Copies all mappings from the specified map to this multi-valued map (optional operation).
The effect of this call is equivalent to that of calling
The behavior of this operation is undefined if the specified map is modified while the operation is in progress.
| |
| remove | back to summary |
|---|---|
| public Collection Overrides org. Implements org. Doc from org. Removes all values associated with the specified key. The returned collection may be modifiable, but updates will not be propagated to this multi-valued map. In case no mapping was stored for the specified key, an empty, unmodifiable collection will be returned.
| |
| removeMapping | back to summary |
|---|---|
| public boolean removeMapping(final Object key, final Object item) Overrides org. Implements org. Doc from org. Removes a key-value mapping from the map. The item is removed from the collection mapped to the specified key. Other values attached to that key are unaffected.
If the last value for a key is removed, implementations typically return
an empty collection from a subsequent | |
| unmodifiableMultiValuedMap | back to summary |
|---|---|
| public static <K, V> UnmodifiableMultiValuedMap Factory method to create an unmodifiable MultiValuedMap. If the map passed in is already unmodifiable, it is returned.
| |
| values | back to summary |
|---|---|
| public Collection Overrides org. Implements org. Doc from org. Gets a Implementations typically return a collection containing the combination of values from all keys.
| |