Top Description Constructors Methods
com.google.common.collect

public abstract Class ForwardingSetMultimap<K extends @Nullable Object, V extends @Nullable Object>

extends ForwardingMultimap<K extends @Nullable Object, V extends @Nullable Object>
implements SetMultimap<K extends @Nullable Object, V extends @Nullable Object>
Class Inheritance
All Implemented Interfaces
com.google.common.collect.SetMultimap, com.google.common.collect.Multimap
Known Direct Subclasses
com.google.common.collect.ForwardingSortedSetMultimap
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, com.google.errorprone.annotations.CanIgnoreReturnValue, java.util.Map.Entry, .Set, javax.annotation.CheckForNull, org.checkerframework.checker.nullness.qual.Nullable

A set multimap which forwards all its method calls to another set multimap. Subclasses should override one or more methods to modify the behavior of the backing multimap as desired per the decorator pattern.

default method warning: This class does not forward calls to default methods. Instead, it inherits their default implementations. When those implementations invoke methods, they invoke methods on the ForwardingSetMultimap.

Author
Kurt Alfred Kluever
Since
3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract SetMultimap<K, V>
delegate()

Implements abstract com.google.common.collect.ForwardingMultimap.delegate.

Returns the backing delegate instance that methods are forwarded to.
public Set<Map.Entry<K, V>>
entries()

Overrides com.google.common.collect.ForwardingMultimap.entries.

Implements com.google.common.collect.SetMultimap.entries, com.google.common.collect.Multimap.entries.

Returns a view collection of all key-value pairs contained in this multimap, as Entry instances.
public Set<V>
get(K key)

Overrides com.google.common.collect.ForwardingMultimap.get.

Implements com.google.common.collect.SetMultimap.get, com.google.common.collect.Multimap.get.

Returns a view collection of the values associated with key in this multimap, if any.
public Set<V>
public Set<V>
replaceValues(K key, Iterable<? extends V> values)

Overrides com.google.common.collect.ForwardingMultimap.replaceValues.

Implements com.google.common.collect.SetMultimap.replaceValues, com.google.common.collect.Multimap.replaceValues.

Stores a collection of values with the same key, replacing any existing values for that key.
Inherited from com.google.common.collect.ForwardingMultimap:
asMapclearcontainsEntrycontainsKeycontainsValueequalshashCodeisEmptykeyskeySetputputAllputAllremovesizevalues

Constructor Detail

ForwardingSetMultimapback to summary
public ForwardingSetMultimap()

Method Detail

delegateback to summary
protected abstract SetMultimap<K, V> delegate()

Implements abstract com.google.common.collect.ForwardingMultimap.delegate.

Doc from com.google.common.collect.ForwardingObject.delegate.

Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet#delegate. Concrete subclasses override this method to supply the instance being decorated.

Annotations
@Override
entriesback to summary
public Set<Map.Entry<K, V>> entries()

Overrides com.google.common.collect.ForwardingMultimap.entries.

Implements com.google.common.collect.SetMultimap.entries, com.google.common.collect.Multimap.entries.

Doc from com.google.common.collect.SetMultimap.entries.

Returns a view collection of all key-value pairs contained in this multimap, as Entry instances.

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 SetMultimap has unique values for a given key, this method returns a Set, instead of the java.util.Collection specified in the Multimap interface.

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

Overrides com.google.common.collect.ForwardingMultimap.get.

Implements com.google.common.collect.SetMultimap.get, com.google.common.collect.Multimap.get.

Doc from com.google.common.collect.SetMultimap.get.

Returns a view collection of the values associated with key in this multimap, if any. Note that when containsKey(key) is false, this returns an empty collection, not null.

Changes to the returned collection will update the underlying multimap, and vice versa.

Because a SetMultimap has unique values for a given key, this method returns a Set, instead of the java.util.Collection specified in the Multimap interface.

Annotations
@Override
removeAllback to summary
public Set<V> removeAll(Object key)

Overrides com.google.common.collect.ForwardingMultimap.removeAll.

Implements com.google.common.collect.SetMultimap.removeAll, com.google.common.collect.Multimap.removeAll.

Doc from com.google.common.collect.SetMultimap.removeAll.

Removes all values associated with the key key.

Once this method returns, key will not be mapped to any values, so it will not appear in keySet(), asMap(), or any other views.

Because a SetMultimap has unique values for a given key, this method returns a Set, instead of the java.util.Collection specified in the Multimap interface.

Returns:Set<V>

Doc from com.google.common.collect.Multimap.removeAll.

the values that were removed (possibly empty). The returned collection may be modifiable, but updating it will have no effect on the multimap.

Annotations
@CanIgnoreReturnValue
@Override
replaceValuesback to summary
public Set<V> replaceValues(K key, Iterable<? extends V> values)

Overrides com.google.common.collect.ForwardingMultimap.replaceValues.

Implements com.google.common.collect.SetMultimap.replaceValues, com.google.common.collect.Multimap.replaceValues.

Doc from com.google.common.collect.SetMultimap.replaceValues.

Stores a collection of values with the same key, replacing any existing values for that key.

If values is empty, this is equivalent to removeAll(key).

Because a SetMultimap has unique values for a given key, this method returns a Set, instead of the java.util.Collection specified in the Multimap interface.

Any duplicates in values will be stored in the multimap once.

Returns:Set<V>

Doc from com.google.common.collect.Multimap.replaceValues.

the collection of replaced values, or an empty collection if no values were previously associated with the key. The collection may be modifiable, but updating it will have no effect on the multimap.

Annotations
@CanIgnoreReturnValue
@Override