Top Description Constructors Methods
com.google.common.collect

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

extends ForwardingMultimap<K extends @Nullable Object, V extends @Nullable Object>
implements ListMultimap<K extends @Nullable Object, V extends @Nullable Object>
Class Inheritance
All Implemented Interfaces
com.google.common.collect.ListMultimap, com.google.common.collect.Multimap
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, com.google.errorprone.annotations.CanIgnoreReturnValue, java.util.List, javax.annotation.CheckForNull, org.checkerframework.checker.nullness.qual.Nullable

A list multimap which forwards all its method calls to another list 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 ForwardingListMultimap.

Author
Kurt Alfred Kluever
Since
3.0

Constructor Summary

AccessConstructor and Description
protected
ForwardingListMultimap()

Constructor for use by subclasses.

Method Summary

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

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

Returns the backing delegate instance that methods are forwarded to.
public List<V>
get(K key)

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

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

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

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

Implements com.google.common.collect.ListMultimap.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:
asMapclearcontainsEntrycontainsKeycontainsValueentriesequalshashCodeisEmptykeyskeySetputputAllputAllremovesizevalues

Constructor Detail

ForwardingListMultimapback to summary
protected ForwardingListMultimap()

Constructor for use by subclasses.

Method Detail

delegateback to summary
protected abstract ListMultimap<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
getback to summary
public List<V> get(K key)

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

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

Doc from com.google.common.collect.ListMultimap.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 the values for a given key may have duplicates and follow the insertion ordering, this method returns a List, instead of the java.util.Collection specified in the Multimap interface.

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

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

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

Doc from com.google.common.collect.ListMultimap.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 the values for a given key may have duplicates and follow the insertion ordering, this method returns a List, instead of the java.util.Collection specified in the Multimap interface.

Returns:List<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 List<V> replaceValues(K key, Iterable<? extends V> values)

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

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

Doc from com.google.common.collect.ListMultimap.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 the values for a given key may have duplicates and follow the insertion ordering, this method returns a List, instead of the java.util.Collection specified in the Multimap interface.

Returns:List<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