public abstract class AbstractMutableMultimap<K,V,C extends com.gs.collections.api.collection.MutableCollection<V>> extends AbstractMultimap<K,V,C> implements com.gs.collections.api.multimap.MutableMultimap<K,V>
| Modifier and Type | Field and Description |
|---|---|
protected com.gs.collections.api.map.MutableMap<K,C> |
map |
protected int |
totalSize |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMutableMultimap() |
protected |
AbstractMutableMultimap(int size) |
protected |
AbstractMutableMultimap(com.gs.collections.api.map.MutableMap<K,C> newMap) |
protected |
AbstractMutableMultimap(com.gs.collections.api.tuple.Pair<K,V>... pairs)
Constructs a
Multimap containing all the Pairs. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToTotalSize(int value)
This method is provided to allow for subclasses to provide the behavior.
|
void |
clear() |
protected void |
clearTotalSize()
This method is provided to allow for subclasses to provide the behavior.
|
protected abstract com.gs.collections.api.map.MutableMap<K,C> |
createMap() |
protected abstract com.gs.collections.api.map.MutableMap<K,C> |
createMapWithKeyCount(int keyCount) |
protected void |
decrementTotalSize()
This method is provided to allow for subclasses to provide the behavior.
|
C |
get(K key)
Returns a view of all values associated with the given key.
|
protected com.gs.collections.api.map.MutableMap<K,C> |
getMap() |
protected void |
incrementTotalSize()
This method is provided to allow for subclasses to provide the behavior.
|
boolean |
isEmpty()
Returns
true if there are no entries. |
boolean |
put(K key,
V value) |
boolean |
putAll(K key,
java.lang.Iterable<? extends V> values) |
<KK extends K,VV extends V> |
putAll(com.gs.collections.api.multimap.Multimap<KK,VV> multimap) |
boolean |
putAllPairs(com.gs.collections.api.tuple.Pair<K,V>... pairs) |
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.
|
protected void |
subtractFromTotalSize(int value)
This method is provided to allow for subclasses to provide the behavior.
|
com.gs.collections.api.map.MutableMap<K,com.gs.collections.api.RichIterable<V>> |
toMap()
Returns a new
MutableMap of keys from this Multimap to the mapped values as a RichIterable. |
void |
writeExternal(java.io.ObjectOutput out) |
containsKey, containsKeyAndValue, containsValue, createCollection, createCollectionBlock, equals, forEachKey, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, toMap, toString, valuesViewclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, toImmutable, toMap, toMutable, valuesViewprotected com.gs.collections.api.map.MutableMap<K,C extends com.gs.collections.api.collection.MutableCollection<V>> map
protected int totalSize
protected AbstractMutableMultimap()
protected AbstractMutableMultimap(com.gs.collections.api.map.MutableMap<K,C> newMap)
protected AbstractMutableMultimap(int size)
protected abstract com.gs.collections.api.map.MutableMap<K,C> createMapWithKeyCount(int keyCount)
public int size()
protected void incrementTotalSize()
protected void decrementTotalSize()
protected void addToTotalSize(int value)
protected void subtractFromTotalSize(int value)
protected void clearTotalSize()
public int sizeDistinct()
com.gs.collections.api.multimap.Multimappublic boolean isEmpty()
com.gs.collections.api.multimap.Multimaptrue if there are no entries.public boolean remove(java.lang.Object key,
java.lang.Object value)
public <KK extends K,VV extends V> boolean putAll(com.gs.collections.api.multimap.Multimap<KK,VV> multimap)
public C removeAll(java.lang.Object key)
public void clear()
public C get(K key)
com.gs.collections.api.multimap.MultimapRichIterable is returned.public com.gs.collections.api.map.MutableMap<K,com.gs.collections.api.RichIterable<V>> toMap()
com.gs.collections.api.multimap.MultimapMutableMap 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.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundException