ImmutableMultimap<K,V>
, Multimap<K,V>
ImmutableBagMultimapImpl
, ImmutableListMultimapImpl
, ImmutableSetMultimapImpl
, ImmutableSortedBagMultimapImpl
, ImmutableSortedSetMultimapImpl
public 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 java.util.Collection<V>> |
toMap(Function0<R> collectionFactory) |
Returns a new
MutableMap of keys from this Multimap to the mapped values as a RichIterable . |
collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toString, valuesView
collectKeysValues, collectValues, flip, newEmpty, newWith, newWithAll, newWithout, newWithoutAll, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues
collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toMutable, valuesView
public int size()
Multimap
This method is implemented with O(1) (constant-time) performance.
public int sizeDistinct()
Multimap
sizeDistinct
in interface Multimap<K,V>
public boolean isEmpty()
Multimap
true
if there are no entries.public SetIterable<K> keySet()
Multimap
SetIterable
of keys with O(1) complexity.public C get(K key)
Multimap
If the given key does not exist, an empty RichIterable
is returned.
public MutableMap<K,RichIterable<V>> toMap()
Multimap
MutableMap
of keys from this Multimap to the mapped values as a RichIterable
.public <R extends java.util.Collection<V>> MutableMap<K,R> toMap(Function0<R> collectionFactory)
Multimap
MutableMap
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–2017. All rights reserved.