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 |
---|---|
boolean |
add(Pair<K,V> keyValuePair)
Modification operation similar to put, however, takes the key-value pair as the input.
|
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. |
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) |
boolean |
putAllPairs(Pair<K,V>... pairs) |
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, valuesView
collectKeysValues, collectValues, flip, newEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues
collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toImmutable, toMutable, valuesView
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 add(Pair<K,V> keyValuePair)
MutableMultimap
add
in interface MutableMultimap<K,V>
keyValuePair
- key value pair to add in the multimapMutableMultimap.put(Object, Object)
public boolean remove(Object key, Object value)
remove
in interface MutableMultimap<K,V>
public boolean putAllPairs(Pair<K,V>... pairs)
putAllPairs
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 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 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(ObjectOutput out) throws IOException
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
Copyright © 2004–2016. All rights reserved.