Multimap that does not allow duplicate key-value entries and that
returns collections whose iterators follow the ordering in which the data was added to the
multimap.
The collections returned by keySet, keys, and asMap iterate through
the keys in the order they were first added to the multimap. Similarly, get, removeAll, and replaceValues return collections that iterate through the values in the
order they were added. The collections generated by entries and values iterate
across the key-value mappings in the order they were added to the multimap.
The iteration ordering of the collections generated by keySet, keys, and
asMap has a few subtleties. As long as the set of keys remains unchanged, adding or
removing mappings does not affect the key iteration order. However, if you remove all values
associated with a key and then add the key back to the multimap, that key will come last in the
key iteration order.
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. 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 LinkedHashMultimap
in a way that affects its Object#equals behavior. Undefined behavior and bugs will
result.
See the Guava User Guide article on Multimap.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | LinkedHashMultimap.ValueEntry<K extends @Nullable Object, V extends @Nullable Object>
LinkedHashMultimap entries are in no less than three coexisting linked lists: a bucket in the
hash table for a |
| pack-priv class | |
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private transient LinkedHashMultimap. | |
| private static final long | |
| pack-priv static final double | |
| pack-priv transient int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Overrides com. Implements com. |
| public static <K extends @Nullable Object, V extends @Nullable Object> LinkedHashMultimap | |
| public static <K extends @Nullable Object, V extends @Nullable Object> LinkedHashMultimap | 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> LinkedHashMultimap | |
| pack-priv Set | Returns: a newLinkedHashSet containing a collection of values for one keyImplements abstract com. |
| pack-priv Collection | Returns: a new decorated set containing a collection of values for one keykey to associate with values in the collection key)Overrides com. |
| private static <K extends @Nullable Object, V extends @Nullable Object> void | |
| private static <K extends @Nullable Object, V extends @Nullable Object> void | |
| public Set | entries()
Overrides com. Implements com. |
| pack-priv Iterator | entryIterator()
Overrides com. entries().iterator() and
values().iterator().
|
| pack-priv Spliterator | |
| public Set | keySet()
Overrides com. Implements com. |
| private void | |
| public Set | replaceValues(K key, Iterable<? extends V> values)
Overrides com. Implements com. |
| private static <K extends @Nullable Object, V extends @Nullable Object> void | succeedsInMultimap(LinkedHashMultimap.
|
| private static <K extends @Nullable Object, V extends @Nullable Object> void | succeedsInValueSet(LinkedHashMultimap.
|
| pack-priv Iterator | |
| public Collection | values()
Overrides com. Implements com. |
| pack-priv Spliterator | |
| private void |