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 TypeMethodDescriptionvoid
clear()
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.boolean
isEmpty()
Returnstrue
if there are no entries.keySet()
Returns an unmodifiableSetIterable
of keys with O(1) complexity.boolean
boolean
void
boolean
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
Returns the number of distinct keys.toMap()
Returns a newMutableMap
of keys from this Multimap to the mapped values as aRichIterable
.<R extends Collection<V>>
MutableMap<K,R> Returns a newMutableMap
of keys from this Multimap to the mapped values as aRichIterable
.void
Methods 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, valuesView
Methods 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, valuesView
Methods 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:Multimap
Returns the number of distinct keys.- Specified by:
sizeDistinct
in interfaceMultimap<K,
V>
-
isEmpty
public boolean isEmpty()Description copied from interface:Multimap
Returnstrue
if there are no entries. -
put
- Specified by:
put
in interfaceMutableMultimap<K,
V>
-
remove
- Specified by:
remove
in interfaceMutableMultimap<K,
V>
-
putAll
- Specified by:
putAll
in interfaceMutableMultimap<K,
V>
-
putAll
- Specified by:
putAll
in interfaceMutableMultimap<K,
V>
-
replaceValues
- Specified by:
replaceValues
in interfaceMutableMultimap<K,
V>
-
removeAll
- Specified by:
removeAll
in interfaceMutableMultimap<K,
V>
-
clear
public void clear()- Specified by:
clear
in interfaceMutableMultimap<K,
V>
-
keySet
Description copied from interface:Multimap
Returns an unmodifiableSetIterable
of keys with O(1) complexity. -
get
Description copied from interface:Multimap
Returns a view of all values associated with the given key.If the given key does not exist, an empty
RichIterable
is returned. -
getIfAbsentPutAll
Description copied from interface:MutableMultimap
Puts 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:
getIfAbsentPutAll
in interfaceMutableMultimap<K,
V>
-
toMap
Description copied from interface:Multimap
Returns a newMutableMap
of keys from this Multimap to the mapped values as aRichIterable
. -
toMap
Description copied from interface:Multimap
Returns a newMutableMap
of keys from this Multimap to the mapped values as aRichIterable
. -
writeExternal
- Throws:
IOException
-
readExternal
- Throws:
IOException
ClassNotFoundException
-