@GwtCompatible public abstract class ForwardingSortedSetMultimap<K,V> extends ForwardingSetMultimap<K,V> implements SortedSetMultimap<K,V>
A sorted set multimap which forwards all its method calls to another sorted set multimap. Subclasses should override one or more methods to modify the behavior of the backing multimap as desired per the decorator pattern.
Modifier | Constructor and Description |
---|---|
protected |
ForwardingSortedSetMultimap()
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
protected abstract SortedSetMultimap<K,V> |
delegate()
Returns the backing delegate instance that methods are forwarded to.
|
SortedSet<V> |
get(K key)
Returns a view collection of the values associated with
key in this multimap, if any. |
SortedSet<V> |
removeAll(Object key)
Removes all values associated with the key
key . |
SortedSet<V> |
replaceValues(K key,
Iterable<? extends V> values)
Stores a collection of values with the same key, replacing any existing values for that key.
|
Comparator<? super V> |
valueComparator()
Returns the comparator that orders the multimap values, with
null indicating that natural ordering is used. |
entries
asMap, clear, containsEntry, containsKey, containsValue, equals, hashCode, isEmpty, keys, keySet, put, putAll, putAll, remove, size, values
toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asMap
entries, equals
clear, containsEntry, containsKey, containsValue, hashCode, isEmpty, keys, keySet, put, putAll, putAll, remove, size, values
protected ForwardingSortedSetMultimap()
Constructor for use by subclasses.
protected abstract SortedSetMultimap<K,V> delegate()
ForwardingObject
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.
delegate
in class ForwardingSetMultimap<K,V>
public SortedSet<V> get(@Nullable K key)
Multimap
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.
public SortedSet<V> removeAll(@Nullable Object key)
Multimap
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 Multimap.keySet()
, Multimap.asMap()
, or any other views.
removeAll
in interface Multimap<K,V>
removeAll
in interface SetMultimap<K,V>
removeAll
in interface SortedSetMultimap<K,V>
removeAll
in class ForwardingSetMultimap<K,V>
public SortedSet<V> replaceValues(K key, Iterable<? extends V> values)
Multimap
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)
.
replaceValues
in interface Multimap<K,V>
replaceValues
in interface SetMultimap<K,V>
replaceValues
in interface SortedSetMultimap<K,V>
replaceValues
in class ForwardingSetMultimap<K,V>
public Comparator<? super V> valueComparator()
SortedSetMultimap
Returns the comparator that orders the multimap values, with null
indicating that natural ordering is used.
valueComparator
in interface SortedSetMultimap<K,V>