Class ArrayListMultimap<K,​V>

    • Constructor Detail

      • ArrayListMultimap

        private ArrayListMultimap()
      • ArrayListMultimap

        private ArrayListMultimap​(int expectedKeys,
                                  int expectedValuesPerKey)
      • ArrayListMultimap

        private ArrayListMultimap​(Multimap<? extends K,​? extends V> multimap)
    • Method Detail

      • create

        public static <K,​V> ArrayListMultimap<K,​V> create()
        Creates a new, empty ArrayListMultimap with the default initial capacities.
      • create

        public static <K,​V> ArrayListMultimap<K,​V> create​(int expectedKeys,
                                                                      int expectedValuesPerKey)
        Constructs an empty ArrayListMultimap with enough capacity to hold the specified numbers of keys and values without resizing.
        Parameters:
        expectedKeys - the expected number of distinct keys
        expectedValuesPerKey - the expected average number of values per key
        Throws:
        java.lang.IllegalArgumentException - if expectedKeys or expectedValuesPerKey is negative
      • create

        public static <K,​V> ArrayListMultimap<K,​V> create​(Multimap<? extends K,​? extends V> multimap)
        Constructs an ArrayListMultimap with the same mappings as the specified multimap.
        Parameters:
        multimap - the multimap whose contents are copied to this multimap
      • createCollection

        java.util.List<V> createCollection()
        Creates a new, empty ArrayList to hold the collection of values for an arbitrary key.
        Specified by:
        createCollection in class AbstractListMultimap<K,​V>
        Returns:
        an empty collection of values
      • trimToSize

        public void trimToSize()
        Reduces the memory used by this ArrayListMultimap, if feasible.
      • writeObject

        @GwtIncompatible
        private void writeObject​(java.io.ObjectOutputStream stream)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • readObject

        @GwtIncompatible
        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException