Multimap using hash tables.
The multimap does not store duplicate key-value pairs. Adding a new key-value pair equal to an existing key-value pair has no effect.
Keys and values may be null. All optional multimap methods are supported, and all returned views are modifiable.
This class is not threadsafe when any concurrent operations update the multimap. Concurrent
read operations will work correctly if the last write happens-before any reads. To allow
concurrent update operations, wrap your multimap with a call to Multimaps#synchronizedSetMultimap.
Warning
Do not modify either a key or a value of a HashMultimap in a
way that affects its Object#equals behavior. Undefined behavior and bugs will result.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| pack-priv transient int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| private | |
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMultimap | |
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMultimap | create(int
the expected number of distinct keys expectedKeys, int the expected average number of values per key expectedValuesPerKey)Constructs an empty |
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMultimap | |
| pack-priv Set | Returns: a newHashSet containing a collection of values for one keyImplements abstract com. |
| private void | |
| private void |
| DEFAULT_VALUES_PER_KEY | back to summary |
|---|---|
| private static final int DEFAULT_VALUES_PER_KEY | |
| expectedValuesPerKey | back to summary |
|---|---|
| pack-priv transient int expectedValuesPerKey
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| HashMultimap | back to summary |
|---|---|
| private HashMultimap() | |
| HashMultimap | back to summary |
|---|---|
| private HashMultimap(int expectedKeys, int expectedValuesPerKey) | |
| HashMultimap | back to summary |
|---|---|
| private HashMultimap(Multimap<? extends K, ? extends V> multimap) | |
| create | back to summary |
|---|---|
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMultimap Creates a new, empty This method will soon be deprecated in favor of | |
| create | back to summary |
|---|---|
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMultimap Constructs an empty This method will soon be deprecated in favor of
| |
| create | back to summary |
|---|---|
| public static <K extends @Nullable Object, V extends @Nullable Object> HashMultimap Constructs a This method will soon be deprecated in favor of
| |
| createCollection | back to summary |
|---|---|
| pack-priv Set Implements abstract com. Doc from com. Creates the collection of values for a single key. Collections with weak, soft, or phantom references are not supported. Each call to The returned collection class determines whether duplicate key-value pairs are allowed. Creates an empty | |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
| |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream stream) throws IOException
| |