public abstract class AbstractMutableMultimap<K,V,C extends MutableCollection<V>> extends AbstractMultimap<K,V,C> implements MutableMultimap<K,V>
| Modifier and Type | Method and 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,
Iterable<? extends V> values) |
<KK extends K,VV extends V> |
putAll(Multimap<KK,VV> multimap) |
void |
readExternal(ObjectInput in) |
boolean |
remove(Object key,
Object value) |
C |
removeAll(Object key) |
C |
replaceValues(K key,
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 Collection<V>> |
toMap(Function0<R> collectionFactory)
Returns a new
MutableMap of keys from this Multimap to the mapped values as a RichIterable. |
void |
writeExternal(ObjectOutput out) |
collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toString, valuesViewadd, asSynchronized, collectKeysValues, collectValues, flip, newEmpty, putAllPairs, putAllPairs, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValuescollectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toImmutable, toMutable, valuesViewpublic int size()
public int sizeDistinct()
MultimapsizeDistinct in interface Multimap<K,V>public boolean isEmpty()
Multimaptrue if there are no entries.public boolean remove(Object key, Object value)
remove in interface MutableMultimap<K,V>public boolean putAll(K key, 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, Iterable<? extends V> values)
replaceValues in interface MutableMultimap<K,V>public void clear()
clear in interface MutableMultimap<K,V>public SetIterable<K> keySet()
MultimapSetIterable 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()
MultimapMutableMap of keys from this Multimap to the mapped values as a RichIterable.public <R extends Collection<V>> MutableMap<K,R> toMap(Function0<R> collectionFactory)
MultimapMutableMap of keys from this Multimap to the mapped values as a RichIterable.public void writeExternal(ObjectOutput out) throws IOException
IOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2004–2017. All rights reserved.