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. |
containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, toMap, toString, valuesViewnewEmptycontainsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, toMap, toMutable, valuesViewpublic int size()
Multimappublic int sizeDistinct()
MultimapsizeDistinct in interface Multimap<K,V>public boolean isEmpty()
Multimaptrue if there are no entries.public C get(K key)
MultimapRichIterable is returned.public MutableMap<K,RichIterable<V>> toMap()
MultimapMutableMap 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()
MultimapSerializable if this Multimap is Serializable.toImmutable in interface Multimap<K,V>Copyright © 2004–2017. All rights reserved.