MultiValuedMap to provide additional behaviour.
Each method call made on this MultiValuedMap is forwarded to the
decorated MultiValuedMap. This class is used as a framework to build
to extensions such as synchronized and unmodifiable behaviour.
| Modifier and Type | Field and Description |
|---|---|
| private final MultiValuedMap | map
MultiValuedMap to decorate |
| private static final long | serialVersionUID
Serialization version |
| Access | Constructor and Description |
|---|---|
| protected | AbstractMultiValuedMapDecorator(final MultiValuedMap<K, V>
the map to decorate, must not be null map)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public Map | asMap()
Implements org. Map from each distinct
key to the non-empty collection of that key's associated values.
|
| public void | clear()
Implements org. |
| public boolean | containsKey(final Object
key whose presence in this map is to be tested key)Implements org. true if this map contains a mapping for the specified
key.
|
| public boolean | containsMapping(final Object
the key to search for key, final Object the value to search for value)Implements org. |
| public boolean | containsValue(final Object
the value to search for value)Implements org. |
| protected MultiValuedMap | |
| public Collection | entries()
Implements org. Collection view of the mappings contained in this multi-valued map.
|
| public boolean | equals(final Object
the reference object with which to compare. object)Overrides java. |
| public Collection | get(final K
the key to retrieve key)Implements org. |
| public int | |
| public boolean | isEmpty()
Implements org. true if this map contains no key-value mappings.
|
| public MultiSet | keys()
Implements org. MultiSet view of the keys contained in this multi-valued map.
|
| public Set | keySet()
Implements org. Set view of the keys contained in this multi-valued map.
|
| public MapIterator | mapIterator()
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)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)Implements org. |
| public boolean | putAll(final Map<? extends K, ? extends V>
mappings to be stored in this map, may not be null map)Implements org. |
| public boolean | putAll(final MultiValuedMap<? extends K, ? extends V>
mappings to be stored in this map, may not be null map)Implements org. |
| public Collection | remove(final Object
the key to remove values from key)Implements org. |
| public boolean | removeMapping(final Object
the key to remove from key, final Object the item to remove item)Implements org. |
| public int | size()
Implements org. |
| public String | |
| public Collection | values()
Implements org. Collection view of all values contained in this multi-valued map.
|
| map | back to summary |
|---|---|
| private final MultiValuedMap<K, V> map MultiValuedMap to decorate | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version | |
| AbstractMultiValuedMapDecorator | back to summary |
|---|---|
| protected AbstractMultiValuedMapDecorator(final MultiValuedMap<K, V> map) Constructor that wraps (not copies).
| |
| asMap | back to summary |
|---|---|
| public Map 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() Implements org. Doc from org. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(final Object key) Implements org. Doc from org. Returns | |
| containsMapping | back to summary |
|---|---|
| public boolean containsMapping(final Object key, final Object value) Implements org. Doc from org. Checks whether the map contains a mapping for the specified key and value. | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(final Object value) Implements org. Doc from org. Checks whether the map contains at least one mapping for the specified value. | |
| decorated | back to summary |
|---|---|
| protected MultiValuedMap The decorated multi-valued map.
| |
| entries | back to summary |
|---|---|
| public Collection 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.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| get | back to summary |
|---|---|
| public Collection 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
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements org. Doc from org. Returns
| |
| keys | back to summary |
|---|---|
| public MultiSet 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 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 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) 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) 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) 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) 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 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) 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 | |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. Gets the total size of the map. Implementations would return the total size of the map which is the count of the values from all keys.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| values | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Gets a Implementations typically return a collection containing the combination of values from all keys.
| |