public abstract class AbstractImmutableMultimap<K,V,C extends ImmutableCollection<V>> extends AbstractMultimap<K,V,C> implements ImmutableMultimap<K,V>
Modifier and Type | Method and 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. |
ImmutableMultimap<K,V> |
newWith(K key,
V value) |
ImmutableMultimap<K,V> |
newWithAll(K key,
Iterable<? extends V> values) |
ImmutableMultimap<K,V> |
newWithout(Object key,
Object value) |
ImmutableMultimap<K,V> |
newWithoutAll(Object key) |
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 . |
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, 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 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 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> newWith(K key, V value)
newWith
in interface ImmutableMultimap<K,V>
public ImmutableMultimap<K,V> newWithout(Object key, Object value)
newWithout
in interface ImmutableMultimap<K,V>
public ImmutableMultimap<K,V> newWithAll(K key, Iterable<? extends V> values)
newWithAll
in interface ImmutableMultimap<K,V>
public ImmutableMultimap<K,V> newWithoutAll(Object key)
newWithoutAll
in interface ImmutableMultimap<K,V>
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–2016. All rights reserved.