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.-
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.<V0 extends Enum<V0>>
MultimapBuilder.SetMultimapBuilder<K0, V0> enumSetValues
(Class<V0> valueClass) Uses anEnumSet
to store value collections.Uses aHashSet
to store value collections.hashSetValues
(int expectedValuesPerKey) Uses aHashSet
to store value collections, initialized to expect the specified number of values per key.Uses aLinkedHashSet
to store value collections.linkedHashSetValues
(int expectedValuesPerKey) Uses aLinkedHashSet
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.
-
Method Details
-
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 aHashSet
to store value collections. -
hashSetValues
Uses aHashSet
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
linkedHashSetValues
Uses aLinkedHashSet
to store value collections. -
linkedHashSetValues
Uses aLinkedHashSet
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.
-