Class AbstractMutableMultimap<K,V,C extends MutableCollection<V>>
java.lang.Object
org.eclipse.collections.impl.multimap.AbstractMultimap<K,V,C>
org.eclipse.collections.impl.multimap.AbstractMutableMultimap<K,V,C>
- All Implemented Interfaces:
Multimap<K,,V> MutableMultimap<K,V>
- Direct Known Subclasses:
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>
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Returns a view of all values associated with the given key.getIfAbsentPutAll(K key, Iterable<? extends V> values) Puts values into multimap if there are no values already associated with key.booleanisEmpty()Returnstrueif there are no entries.keySet()Returns an unmodifiableSetIterableof keys with O(1) complexity.booleanbooleanvoidbooleanreplaceValues(K key, Iterable<? extends V> values) intsize()Use the size method directly instead of totalSize internally so subclasses can override if necessary.intReturns the number of distinct keys.toMap()Returns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable.<R extends Collection<V>>
MutableMap<K,R> Returns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable.voidMethods inherited from class org.eclipse.collections.impl.multimap.AbstractMultimap
collectKeyMultiValues, collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toString, valuesViewMethods inherited from interface org.eclipse.collections.api.multimap.Multimap
collectKeyMultiValues, collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toImmutable, toMutable, valuesViewMethods inherited from interface org.eclipse.collections.api.multimap.MutableMultimap
add, asSynchronized, collectKeyMultiValues, collectKeysValues, collectValues, flip, newEmpty, putAllPairs, putAllPairs, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, withKeyMultiValues, withKeyValue
-
Method Details
-
size
public int size()Use the size method directly instead of totalSize internally so subclasses can override if necessary. -
sizeDistinct
public int sizeDistinct()Description copied from interface:MultimapReturns the number of distinct keys.- Specified by:
sizeDistinctin interfaceMultimap<K,V>
-
isEmpty
public boolean isEmpty()Description copied from interface:MultimapReturnstrueif there are no entries. -
put
- Specified by:
putin interfaceMutableMultimap<K,V>
-
remove
- Specified by:
removein interfaceMutableMultimap<K,V>
-
putAll
- Specified by:
putAllin interfaceMutableMultimap<K,V>
-
putAll
- Specified by:
putAllin interfaceMutableMultimap<K,V>
-
replaceValues
- Specified by:
replaceValuesin interfaceMutableMultimap<K,V>
-
removeAll
- Specified by:
removeAllin interfaceMutableMultimap<K,V>
-
clear
public void clear()- Specified by:
clearin interfaceMutableMultimap<K,V>
-
keySet
Description copied from interface:MultimapReturns an unmodifiableSetIterableof keys with O(1) complexity. -
get
Description copied from interface:MultimapReturns a view of all values associated with the given key.If the given key does not exist, an empty
RichIterableis returned. -
getIfAbsentPutAll
Description copied from interface:MutableMultimapPuts values into multimap if there are no values already associated with key. Then returns a view of the values associated with key, like the result ofMultimap.get(Object)- Specified by:
getIfAbsentPutAllin interfaceMutableMultimap<K,V>
-
toMap
Description copied from interface:MultimapReturns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable. -
toMap
Description copied from interface:MultimapReturns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable. -
writeExternal
- Throws:
IOException
-
readExternal
- Throws:
IOExceptionClassNotFoundException
-