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>
public abstract static class MultimapBuilder.MultimapBuilderWithKeys<K0> extends Object
An intermediate stage in aMultimapBuilder
in which the key-value collection map implementation has been specified, but the value collection implementation has not.- Since:
- 16.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultimapBuilder.ListMultimapBuilder<K0,Object>
arrayListValues()
Uses anArrayList
to store value collections.MultimapBuilder.ListMultimapBuilder<K0,Object>
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.MultimapBuilder.SetMultimapBuilder<K0,Object>
hashSetValues()
Uses a hash-basedSet
to store value collections.MultimapBuilder.SetMultimapBuilder<K0,Object>
hashSetValues(int expectedValuesPerKey)
Uses a hash-basedSet
to store value collections, initialized to expect the specified number of values per key.MultimapBuilder.SetMultimapBuilder<K0,Object>
linkedHashSetValues()
Uses an insertion-ordered hash-basedSet
to store value collections.MultimapBuilder.SetMultimapBuilder<K0,Object>
linkedHashSetValues(int expectedValuesPerKey)
Uses an insertion-ordered hash-basedSet
to store value collections, initialized to expect the specified number of values per key.MultimapBuilder.ListMultimapBuilder<K0,Object>
linkedListValues()
Uses aLinkedList
to store value collections.MultimapBuilder.SortedSetMultimapBuilder<K0,Comparable>
treeSetValues()
Uses a naturally-orderedTreeSet
to store value collections.<V0> MultimapBuilder.SortedSetMultimapBuilder<K0,V0>
treeSetValues(Comparator<V0> comparator)
Uses aTreeSet
ordered by the specified comparator to store value collections.
-
-
-
Method Detail
-
arrayListValues
public MultimapBuilder.ListMultimapBuilder<K0,Object> arrayListValues()
Uses anArrayList
to store value collections.
-
arrayListValues
public MultimapBuilder.ListMultimapBuilder<K0,Object> arrayListValues(int expectedValuesPerKey)
Uses anArrayList
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
linkedListValues
public MultimapBuilder.ListMultimapBuilder<K0,Object> linkedListValues()
Uses aLinkedList
to store value collections.
-
hashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,Object> hashSetValues()
Uses a hash-basedSet
to store value collections.
-
hashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,Object> hashSetValues(int expectedValuesPerKey)
Uses a hash-basedSet
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
linkedHashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,Object> linkedHashSetValues()
Uses an insertion-ordered hash-basedSet
to store value collections.
-
linkedHashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,Object> linkedHashSetValues(int expectedValuesPerKey)
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
public MultimapBuilder.SortedSetMultimapBuilder<K0,Comparable> 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.
-
-