Class AbstractImmutableMultimap<K,V,C extends ImmutableCollection<V>>
java.lang.Object
org.eclipse.collections.impl.multimap.AbstractMultimap<K,V,C>
org.eclipse.collections.impl.multimap.AbstractImmutableMultimap<K,V,C>
- All Implemented Interfaces:
ImmutableMultimap<K,,V> Multimap<K,V>
- Direct Known Subclasses:
ImmutableBagMultimapImpl,ImmutableListMultimapImpl,ImmutableSetMultimapImpl,ImmutableSortedBagMultimapImpl,ImmutableSortedSetMultimapImpl
public abstract class AbstractImmutableMultimap<K,V,C extends ImmutableCollection<V>>
extends AbstractMultimap<K,V,C>
implements ImmutableMultimap<K,V>
-
Method Summary
Modifier and TypeMethodDescriptionReturns a view of all values associated with the given key.booleanisEmpty()Returnstrueif there are no entries.keySet()Returns an unmodifiableSetIterableof keys with O(1) complexity.intsize()Returns the number of key-value entry pairs.intReturns the number of distinct keys.Returns an immutable copy of this Multimap if it is not already immutable.toMap()Returns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable.<R extends Collection<V>>
MutableMap<K,R> Returns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable.Methods inherited from class org.eclipse.collections.impl.multimap.AbstractMultimap
collectKeyMultiValues, collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toString, valuesViewMethods inherited from interface org.eclipse.collections.api.multimap.ImmutableMultimap
collectKeyMultiValues, collectKeysValues, collectValues, flip, newEmpty, newWith, newWithAll, newWithout, newWithoutAll, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValuesMethods inherited from interface org.eclipse.collections.api.multimap.Multimap
collectKeyMultiValues, collectKeysValues, collectValues, containsKey, containsKeyAndValue, containsValue, equals, forEachKey, forEachKeyMultiValues, forEachKeyValue, forEachValue, hashCode, keyBag, keyMultiValuePairsView, keysView, keyValuePairsView, multiValuesView, notEmpty, rejectKeysMultiValues, rejectKeysValues, selectKeysMultiValues, selectKeysValues, toMutable, valuesView
-
Method Details
-
size
public int size()Description copied from interface:MultimapReturns the number of key-value entry pairs.This method is implemented with O(1) (constant-time) performance.
-
sizeDistinct
public int sizeDistinct()Description copied from interface:MultimapReturns the number of distinct keys.- Specified by:
sizeDistinctin interfaceMultimap<K,V>
-
isEmpty
public boolean isEmpty()Description copied from interface:MultimapReturnstrueif there are no entries. -
keySet
Description copied from interface:MultimapReturns an unmodifiableSetIterableof keys with O(1) complexity. -
get
Description copied from interface:MultimapReturns a view of all values associated with the given key.If the given key does not exist, an empty
RichIterableis returned. -
toMap
Description copied from interface:MultimapReturns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable. -
toMap
Description copied from interface:MultimapReturns a newMutableMapof keys from this Multimap to the mapped values as aRichIterable. -
toImmutable
Description copied from interface:MultimapReturns an immutable copy of this Multimap if it is not already immutable. If the Multimap is immutable, it will return itself.The returned Multimap will be
Serializableif this Multimap isSerializable.- Specified by:
toImmutablein interfaceMultimap<K,V>
-