Multimap that uses an ArrayList to store the values for a given
key. A HashMap associates each key with an ArrayList of values.
When iterating through the collections supplied by this class, the ordering of values for a given key agrees with the order in which the values were added.
This multimap allows duplicate key-value pairs. After adding a new key-value pair equal to an
existing key-value pair, the ArrayListMultimap will contain entries for both the new
value and the old value.
Keys and values may be null. All optional multimap methods are supported, and all returned views are modifiable.
The lists returned by get, removeAll, and replaceValues all
implement java..
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#synchronizedListMultimap.
See the Guava User Guide article on Multimap.
| 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> ArrayListMultimap | |
| public static <K extends @Nullable Object, V extends @Nullable Object> ArrayListMultimap | 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> ArrayListMultimap | |
| pack-priv List | createCollection()
Implements abstract com. ArrayList to hold the collection of values for an arbitrary key.
|
| private void | |
| public void | trimToSize()
Deprecated
For a
Reduces the memory used by this ListMultimap that automatically trims to size, use ImmutableListMultimap.
ArrayListMultimap, if feasible.
|
| 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. | |
| ArrayListMultimap | back to summary |
|---|---|
| private ArrayListMultimap() | |
| ArrayListMultimap | back to summary |
|---|---|
| private ArrayListMultimap(int expectedKeys, int expectedValuesPerKey) | |
| ArrayListMultimap | back to summary |
|---|---|
| private ArrayListMultimap(Multimap<? extends K, ? extends V> multimap) | |
| create | back to summary |
|---|---|
| public static <K extends @Nullable Object, V extends @Nullable Object> ArrayListMultimap 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> ArrayListMultimap 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> ArrayListMultimap Constructs an This method will soon be deprecated in favor of
| |
| createCollection | back to summary |
|---|---|
| pack-priv List Implements abstract com. Creates a new, empty
| |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
| |
| trimToSize | back to summary |
|---|---|
| public void trimToSize()
Deprecated For a Reduces the memory used by this
| |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream stream) throws IOException
| |