Package com.google.common.collect
Class MultimapBuilder.MultimapBuilderWithKeys<K0>
java.lang.Object
com.google.common.collect.MultimapBuilder.MultimapBuilderWithKeys<K0>
- Type Parameters:
K0
- The upper bound on the key type of the generated multimap.
- Enclosing class:
MultimapBuilder<K0,
V0>
An intermediate stage in a
MultimapBuilder
in which the key-value collection map
implementation has been specified, but the value collection implementation has not.- Since:
- 16.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUses anArrayList
to store value collections.arrayListValues
(int expectedValuesPerKey) Uses anArrayList
to store value collections, initialized to expect the specified number of values per key.(package private) abstract <K extends K0,
V>
Map<K, Collection<V>> <V0 extends Enum<V0>>
MultimapBuilder.SetMultimapBuilder<K0, V0> enumSetValues
(Class<V0> valueClass) Uses anEnumSet
to store value collections.Uses a hash-basedSet
to store value collections.hashSetValues
(int expectedValuesPerKey) Uses a hash-basedSet
to store value collections, initialized to expect the specified number of values per key.Uses an insertion-ordered hash-basedSet
to store value collections.linkedHashSetValues
(int expectedValuesPerKey) Uses an insertion-ordered hash-basedSet
to store value collections, initialized to expect the specified number of values per key.Uses aLinkedList
to store value collections.Uses a naturally-orderedTreeSet
to store value collections.treeSetValues
(Comparator<V0> comparator) Uses aTreeSet
ordered by the specified comparator to store value collections.
-
Field Details
-
DEFAULT_EXPECTED_VALUES_PER_KEY
private static final int DEFAULT_EXPECTED_VALUES_PER_KEY- See Also:
-
-
Constructor Details
-
MultimapBuilderWithKeys
MultimapBuilderWithKeys()
-
-
Method Details
-
createMap
-
arrayListValues
Uses anArrayList
to store value collections. -
arrayListValues
Uses anArrayList
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
linkedListValues
Uses aLinkedList
to store value collections. -
hashSetValues
Uses a hash-basedSet
to store value collections. -
hashSetValues
Uses a hash-basedSet
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
linkedHashSetValues
Uses an insertion-ordered hash-basedSet
to store value collections. -
linkedHashSetValues
Uses an insertion-ordered hash-basedSet
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
treeSetValues
Uses a naturally-orderedTreeSet
to store value collections. -
treeSetValues
public <V0> MultimapBuilder.SortedSetMultimapBuilder<K0,V0> treeSetValues(Comparator<V0> comparator) Uses aTreeSet
ordered by the specified comparator to store value collections.Multimaps generated by the resulting builder will not be serializable if
comparator
is not serializable. -
enumSetValues
public <V0 extends Enum<V0>> MultimapBuilder.SetMultimapBuilder<K0,V0> enumSetValues(Class<V0> valueClass) Uses anEnumSet
to store value collections.
-