ImmutableMultimap<K,V>, Multimap<K,V>ImmutableBagMultimapImpl, ImmutableListMultimapImpl, ImmutableSetMultimapImpl, ImmutableSortedBagMultimapImpl, ImmutableSortedSetMultimapImplpublic abstract class AbstractImmutableMultimap<K,V,C extends ImmutableCollection<V>> extends AbstractMultimap<K,V,C> implements ImmutableMultimap<K,V>
| Modifier and Type | Method | Description |
|---|---|---|
C |
get(K key) |
Returns a view of all values associated with the given key.
|
boolean |
isEmpty() |
Returns
true if there are no entries. |
SetIterable<K> |
keySet() |
Returns a unmodifiable
SetIterable of keys with O(1) complexity. |
int |
size() |
Returns the number of key-value entry pairs.
|
int |
sizeDistinct() |
Returns the number of distinct keys.
|
ImmutableMultimap<K,V> |
toImmutable() |
Returns an immutable copy of this Multimap if it is not already immutable.
|
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. |
collectKeyMultiValues, collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toString, valuesViewcollectKeyMultiValues, collectKeysValues, collectValues, flip, newEmpty, newWith, newWithAll, newWithout, newWithoutAll, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValuescollectKeyMultiValues, collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toMutable, valuesViewpublic int size()
MultimapThis method is implemented with O(1) (constant-time) performance.
public int sizeDistinct()
MultimapsizeDistinct in interface Multimap<K,V>public boolean isEmpty()
Multimaptrue if there are no entries.public SetIterable<K> keySet()
MultimapSetIterable of keys with O(1) complexity.public C get(K key)
MultimapIf the given key does not exist, an empty RichIterable is returned.
public MutableMap<K,RichIterable<V>> toMap()
MultimapMutableMap of keys from this Multimap to the mapped values as a RichIterable.public <R extends Collection<V>> MutableMap<K,R> toMap(Function0<R> collectionFactory)
MultimapMutableMap of keys from this Multimap to the mapped values as a RichIterable.public ImmutableMultimap<K,V> toImmutable()
Multimap The returned Multimap will be Serializable if this Multimap is Serializable.
toImmutable in interface Multimap<K,V>Copyright © 2004–2019. All rights reserved.