Multimap<K,V>
, MutableMultimap<K,V>
AbstractMutableBagMultimap
, AbstractMutableListMultimap
, AbstractMutableSetMultimap
, AbstractSynchronizedPutMultimap
, TreeBagMultimap
, TreeBagMultimap
, TreeBagMultimap
, TreeSortedSetMultimap
public abstract class AbstractMutableMultimap<K,V,C extends MutableCollection<V>> extends AbstractMultimap<K,V,C> implements MutableMultimap<K,V>
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
C |
get(K key) |
Returns a view of all values associated with the given key.
|
boolean |
isEmpty() |
Returns
true if there are no entries. |
SetIterable<K> |
keySet() |
Returns a unmodifiable
SetIterable of keys with O(1) complexity. |
boolean |
put(K key,
V value) |
|
boolean |
putAll(K key,
java.lang.Iterable<? extends V> values) |
|
<KK extends K,VV extends V> |
putAll(Multimap<KK,VV> multimap) |
|
void |
readExternal(java.io.ObjectInput in) |
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
|
C |
removeAll(java.lang.Object key) |
|
C |
replaceValues(K key,
java.lang.Iterable<? extends V> values) |
|
int |
size() |
Use the size method directly instead of totalSize internally so subclasses can override if necessary.
|
int |
sizeDistinct() |
Returns the number of distinct keys.
|
MutableMap<K,RichIterable<V>> |
toMap() |
Returns a new
MutableMap of keys from this Multimap to the mapped values as a RichIterable . |
<R extends java.util.Collection<V>> |
toMap(Function0<R> collectionFactory) |
Returns a new
MutableMap of keys from this Multimap to the mapped values as a RichIterable . |
void |
writeExternal(java.io.ObjectOutput out) |
collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toString, valuesView
collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toImmutable, toMutable, valuesView
add, asSynchronized, collectKeysValues, collectValues, flip, newEmpty, putAllPairs, putAllPairs, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues
public int size()
public int sizeDistinct()
Multimap
sizeDistinct
in interface Multimap<K,V>
public boolean isEmpty()
Multimap
true
if there are no entries.public boolean remove(java.lang.Object key, java.lang.Object value)
remove
in interface MutableMultimap<K,V>
public boolean putAll(K key, java.lang.Iterable<? extends V> values)
putAll
in interface MutableMultimap<K,V>
public <KK extends K,VV extends V> boolean putAll(Multimap<KK,VV> multimap)
putAll
in interface MutableMultimap<K,V>
public C replaceValues(K key, java.lang.Iterable<? extends V> values)
replaceValues
in interface MutableMultimap<K,V>
public C removeAll(java.lang.Object key)
removeAll
in interface MutableMultimap<K,V>
public void clear()
clear
in interface MutableMultimap<K,V>
public SetIterable<K> keySet()
Multimap
SetIterable
of keys with O(1) complexity.public C get(K key)
Multimap
If the given key does not exist, an empty RichIterable
is returned.
public MutableMap<K,RichIterable<V>> toMap()
Multimap
MutableMap
of keys from this Multimap to the mapped values as a RichIterable
.public <R extends java.util.Collection<V>> MutableMap<K,R> toMap(Function0<R> collectionFactory)
Multimap
MutableMap
of keys from this Multimap to the mapped values as a RichIterable
.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
Copyright © 2004–2018. All rights reserved.