SetMultimap interface. It's a wrapper around AbstractMapBasedMultimap that converts the returned collections into Sets. The createCollection method must return a Set.
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | AbstractSetMultimap(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 Set | createCollection()
Implements abstract com. |
| pack-priv Set | createUnmodifiableEmptyCollection()
Overrides com. |
| public Set | entries()
Overrides com. Implements com. Entry
instances.
|
| public boolean | equals(Object
the reference object with which to compare. object)Overrides com. Implements com. |
| public Set | get(K key)
Overrides com. Implements com. key in this multimap, if any.
|
| public boolean | Returns: true if the method increased the size of the multimap, or false if the
multimap already contained the key-value pairkey to store in the multimap key, V value to store in the multimap value)Overrides com. Implements com. |
| public Set | removeAll(Object key)
Overrides com. Implements com. key.
|
| public Set | 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. | |
| AbstractSetMultimap | back to summary |
|---|---|
| protected AbstractSetMultimap(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 Set 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 Set Overrides com. Doc from com. Creates an unmodifiable, empty collection of values. This is used in
| |
| entries | back to summary |
|---|---|
| public Set Overrides com. Implements com. Doc from com. Returns a view collection of all key-value pairs contained in this multimap, as Changes to the returned collection or the entries it contains will update the underlying multimap, and vice versa. However, adding to the returned collection is not possible. Because a Because a
| |
| 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 Set 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 a Because 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 Set Overrides com. Implements com. Doc from com. Removes all values associated with the key Once this method returns, Because a Because a
| |
| replaceValues | back to summary |
|---|---|
| public Set 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 a Any duplicates in Because a Any duplicates in
| |
| 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.
| |