ListMultimap interface. It's a wrapper around AbstractMapBasedMultimap that converts the returned collections into Lists. The createCollection method must return a List.
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | AbstractListMultimap(Map<K, Collection<V>>
place to store the mapping from each key to its corresponding values map)Creates a new multimap that uses the provided map. |
| Modifier and Type | Method and Description |
|---|---|
| public Map | asMap()
Overrides com. Implements com. Map from each distinct key to the nonempty
collection of that key's associated values.
|
| pack-priv abstract List | createCollection()
Implements abstract com. |
| pack-priv List | createUnmodifiableEmptyCollection()
Overrides com. |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides com. Implements com. |
| public List | get(K key)
Overrides com. Implements com. key in this multimap, if any.
|
| public boolean | Returns: true alwayskey to store in the multimap key, V value to store in the multimap value)Overrides com. Implements com. |
| public List | removeAll(Object key)
Overrides com. Implements com. key.
|
| public List | replaceValues(K key, Iterable<? extends V> values)
Overrides com. Implements com. |
| pack-priv <E extends @Nullable Object> Collection | |
| pack-priv Collection | wrapCollection(K key, Collection<V> collection)
Overrides com. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| AbstractListMultimap | back to summary |
|---|---|
| protected AbstractListMultimap(Map<K, Collection<V>> map) Creates a new multimap that uses the provided map.
| |
| asMap | back to summary |
|---|---|
| public Map Overrides com. Implements com. Doc from com. Returns a view of this multimap as a Changes to the returned map or the collections that serve as its values will update the
underlying multimap, and vice versa. The map does not support Note The returned map's values are guaranteed to be of type Though the method signature doesn't say so explicitly, the returned map has
| |
| createCollection | back to summary |
|---|---|
| pack-priv abstract List Implements abstract com. Doc from com. Creates the collection of values for a single key. Collections with weak, soft, or phantom references are not supported. Each call to The returned collection class determines whether duplicate key-value pairs are allowed. | |
| createUnmodifiableEmptyCollection | back to summary |
|---|---|
| pack-priv List Overrides com. Doc from com. Creates an unmodifiable, empty collection of values. This is used in
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides com. Implements com. Compares the specified object to this multimap for equality. Two
| |
| get | back to summary |
|---|---|
| public List Overrides com. Implements com. Doc from com. Returns a view collection of the values associated with Changes to the returned collection will update the underlying multimap, and vice versa. Because the values for a given key may have duplicates and follow the insertion ordering,
this method returns a Because the values for a given key may have duplicates and follow the insertion ordering,
this method returns a
| |
| put | back to summary |
|---|---|
| public boolean put(K key, V value) Overrides com. Implements com. Stores a key-value pair in the multimap.
| |
| removeAll | back to summary |
|---|---|
| public List Overrides com. Implements com. Doc from com. Removes all values associated with the key Once this method returns, Because the values for a given key may have duplicates and follow the insertion ordering,
this method returns a Because the values for a given key may have duplicates and follow the insertion ordering,
this method returns a
| |
| replaceValues | back to summary |
|---|---|
| public List Overrides com. Implements com. Doc from com. Stores a collection of values with the same key, replacing any existing values for that key. If Because the values for a given key may have duplicates and follow the insertion ordering,
this method returns a Because the values for a given key may have duplicates and follow the insertion ordering,
this method returns a
| |
| unmodifiableCollectionSubclass | back to summary |
|---|---|
| pack-priv <E extends @Nullable Object> Collection Overrides com.
| |
| wrapCollection | back to summary |
|---|---|
| pack-priv Collection Overrides com. Doc from com. Generates a decorated collection that remains consistent with the values in the multimap for the provided key. Changes to the multimap may alter the returned collection, and vice versa.
| |