public abstract class AbstractImmutableMultimap<K,V,C extends com.gs.collections.api.collection.ImmutableCollection<V>> extends AbstractMultimap<K,V,C> implements com.gs.collections.api.multimap.ImmutableMultimap<K,V>
| Modifier and Type | Field and Description |
|---|---|
protected com.gs.collections.api.map.ImmutableMap<K,C> |
map |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractImmutableMultimap(com.gs.collections.api.map.ImmutableMap<K,C> immutableMap)
Creates a new multimap that uses the provided immutableMap.
|
protected |
AbstractImmutableMultimap(com.gs.collections.api.map.MutableMap<K,C> map)
Creates a new multimap that clones the provided map into an ImmutableMap.
|
| Modifier and Type | Method and Description |
|---|---|
C |
get(K key)
Returns a view of all values associated with the given key.
|
protected com.gs.collections.api.map.ImmutableMap<K,C> |
getMap() |
boolean |
isEmpty()
Returns
true if there are no entries. |
com.gs.collections.api.multimap.ImmutableMultimap<K,V> |
newWith(K key,
V value) |
com.gs.collections.api.multimap.ImmutableMultimap<K,V> |
newWithAll(K key,
java.lang.Iterable<? extends V> values) |
com.gs.collections.api.multimap.ImmutableMultimap<K,V> |
newWithout(java.lang.Object key,
java.lang.Object value) |
com.gs.collections.api.multimap.ImmutableMultimap<K,V> |
newWithoutAll(java.lang.Object key) |
protected java.lang.Object |
readResolve() |
int |
size()
Returns the number of key-value entry pairs.
|
int |
sizeDistinct()
Returns the number of distinct keys.
|
com.gs.collections.api.multimap.ImmutableMultimap<K,V> |
toImmutable()
Returns an immutable copy of this Multimap if it is not already immutable.
|
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. |
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, toMap, toMutable, valuesViewprotected AbstractImmutableMultimap(com.gs.collections.api.map.MutableMap<K,C> map)
map - place to store the mapping from each key to its corresponding valuespublic int size()
com.gs.collections.api.multimap.Multimappublic int sizeDistinct()
com.gs.collections.api.multimap.Multimappublic boolean isEmpty()
com.gs.collections.api.multimap.Multimaptrue if there are no entries.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 com.gs.collections.api.multimap.ImmutableMultimap<K,V> newWithout(java.lang.Object key, java.lang.Object value)
public com.gs.collections.api.multimap.ImmutableMultimap<K,V> newWithAll(K key, java.lang.Iterable<? extends V> values)
public com.gs.collections.api.multimap.ImmutableMultimap<K,V> newWithoutAll(java.lang.Object key)
public com.gs.collections.api.multimap.ImmutableMultimap<K,V> toImmutable()
com.gs.collections.api.multimap.MultimapSerializable if this Multimap is Serializable.protected java.lang.Object readResolve()
throws java.io.ObjectStreamException
java.io.ObjectStreamException