Top Description Inners Fields Constructors Methods
io.vavr.collection

public final Class HashMultimap<K, V>

extends AbstractMultimap<K, V, HashMultimap<K, V>>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Type Parameters
<K>
Key type
<V>
Value type
Imports
io.vavr.Tuple2, java.io.Serializable, java.util.ArrayList, .Comparator, .Objects, java.util.function.BiConsumer, .BinaryOperator, .Function, .Supplier, java.util.stream.Collector

A HashMap-based implementation of Multimap
Author
Ruslan Sennov

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from io.vavr.collection.AbstractMultimap:
backemptyContainer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected <K2, V2> HashMultimap<K2, V2>
protected <K2, V2> HashMultimap<K2, V2>
protected <K2, V2> Map<K2, V2>
public static <
Key type
K
,
Value type
V
>
HashMultimap<K, V>

Returns:

the given multimap instance as narrowed type Multimap<K, V>.
narrow
(HashMultimap<? extends K, ? extends V>
A Map.
map
)

Narrows a widened HashMultimap<?

public static <V> HashMultimap.Builder<V>
public static <V> HashMultimap.Builder<V>
public static <V extends Comparable<?>> HashMultimap.Builder<V>
public static <V> HashMultimap.Builder<V>
withSortedSet(Comparator<? super V> comparator)

Inherited from io.vavr.collection.AbstractMultimap:
asMapbimapcontainsKeydistinctdistinctBydistinctBydropdropRightdropUntildropWhileequalsfilterfilterfilterKeysfilterValuesflatMapgetgetContainerTypegetOrElsegroupBygroupedhashCodeheadinitinitOptionisAsyncisEmptyisLazyiteratorkeySetlastmapmapValuesmergemergeorElseorElsepartitionpeekputputrejectrejectrejectKeysrejectValuesremoveremoveremoveAllremoveAllremoveKeysremoveValuesreplacereplacereplaceAllreplaceAllreplaceValueretainAllscansizeslideByslidingslidingspanstringPrefixtailtailOptiontaketakeRighttakeUntiltakeWhiletoJavaMaptoJavaMaptoStringvalues

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.vavr.collection.AbstractMultimap.serialVersionUID, io.vavr.collection.Multimap.serialVersionUID.

Constructor Detail

HashMultimapback to summary
private HashMultimap(Map<K, Traversable<V>> back, Multimap.ContainerType containerType, AbstractMultimap.SerializableSupplier<Traversable<?>> emptyContainer)

Method Detail

createFromMapback to summary
protected <K2, V2> HashMultimap<K2, V2> createFromMap(Map<K2, Traversable<V2>> back)

Implements abstract io.vavr.collection.AbstractMultimap.createFromMap.

Annotations
@Override
emptyInstanceback to summary
protected <K2, V2> HashMultimap<K2, V2> emptyInstance()

Implements abstract io.vavr.collection.AbstractMultimap.emptyInstance.

Annotations
@SuppressWarnings:unchecked
@Override
emptyMapSupplierback to summary
protected <K2, V2> Map<K2, V2> emptyMapSupplier()

Implements abstract io.vavr.collection.AbstractMultimap.emptyMapSupplier.

Annotations
@Override
narrowback to summary
public static <K, V> HashMultimap<K, V> narrow(HashMultimap<? extends K, ? extends V> map)

Narrows a widened HashMultimap<? extends K, ? extends V> to HashMultimap<K, V> by performing a type safe-cast. This is eligible because immutable/read-only collections are covariant.

Parameters
<K>
Key type
<V>
Value type
map:HashMultimap<? extends K, ? extends V>

A Map.

Returns:HashMultimap<K, V>

the given multimap instance as narrowed type Multimap<K, V>.

Annotations
@SuppressWarnings:unchecked
withSeqback to summary
public static <V> HashMultimap.Builder<V> withSeq()
withSetback to summary
public static <V> HashMultimap.Builder<V> withSet()
withSortedSetback to summary
public static <V extends Comparable<?>> HashMultimap.Builder<V> withSortedSet()
withSortedSetback to summary
public static <V> HashMultimap.Builder<V> withSortedSet(Comparator<? super V> comparator)
io.vavr.collection back to summary

public Class HashMultimap.Builder<V>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Multimap.ContainerType
private final AbstractMultimap.SerializableSupplier<Traversable<?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public <
The key type
K
,
The value type
V2 extends V
>
Collector<Tuple2<K, V2>, ArrayList<Tuple2<K, V2>>, Multimap<K, V2>>

Returns:

A HashMultimap Collector.
collector
()

Returns a Collector which may be used in conjunction with java.util.stream.Stream#collect(Collector) to obtain a HashMultimap.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new empty HashMultimap.
empty
()

Returns the empty HashMultimap.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A HashMultimap of size n, where each element contains the result supplied by s.
fill
(int
The number of elements in the HashMultimap
n
,
Supplier<? extends Tuple2<? extends K, ? extends V2>>
The Supplier computing element values
s
)

Returns a HashMultimap containing n values supplied by a given Supplier s.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A HashMultimap of size 1, where each element contains n values of element._2.
fill
(int
The number of elements in the HashMultimap
n
,
Tuple2<? extends K, ? extends V2>
The element
element
)

Returns a HashMultimap containing n times the given element

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
key
,
V2
the value for key
value
)

Creates a HashMultimap of the given key-value pair.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
,
K
a key for the map
k4
,
V2
the value for k4
v4
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
,
K
a key for the map
k4
,
V2
the value for k4
v4
,
K
a key for the map
k5
,
V2
the value for k5
v5
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
,
K
a key for the map
k4
,
V2
the value for k4
v4
,
K
a key for the map
k5
,
V2
the value for k5
v5
,
K
a key for the map
k6
,
V2
the value for k6
v6
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
,
K
a key for the map
k4
,
V2
the value for k4
v4
,
K
a key for the map
k5
,
V2
the value for k5
v5
,
K
a key for the map
k6
,
V2
the value for k6
v6
,
K
a key for the map
k7
,
V2
the value for k7
v7
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
,
K
a key for the map
k4
,
V2
the value for k4
v4
,
K
a key for the map
k5
,
V2
the value for k5
v5
,
K
a key for the map
k6
,
V2
the value for k6
v6
,
K
a key for the map
k7
,
V2
the value for k7
v7
,
K
a key for the map
k8
,
V2
the value for k8
v8
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
,
K
a key for the map
k4
,
V2
the value for k4
v4
,
K
a key for the map
k5
,
V2
the value for k5
v5
,
K
a key for the map
k6
,
V2
the value for k6
v6
,
K
a key for the map
k7
,
V2
the value for k7
v7
,
K
a key for the map
k8
,
V2
the value for k8
v8
,
K
a key for the map
k9
,
V2
the value for k9
v9
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given entries
of
(K
a key for the map
k1
,
V2
the value for k1
v1
,
K
a key for the map
k2
,
V2
the value for k2
v2
,
K
a key for the map
k3
,
V2
the value for k3
v3
,
K
a key for the map
k4
,
V2
the value for k4
v4
,
K
a key for the map
k5
,
V2
the value for k5
v5
,
K
a key for the map
k6
,
V2
the value for k6
v6
,
K
a key for the map
k7
,
V2
the value for k7
v7
,
K
a key for the map
k8
,
V2
the value for k8
v8
,
K
a key for the map
k9
,
V2
the value for k9
v9
,
K
a key for the map
k10
,
V2
the value for k10
v10
)

Creates a HashMultimap of the given list of key-value pairs.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new HashMultimap containing the given entry.
of
(Tuple2<? extends K, ? extends V2>
A tuple containing the key-value pair.
entry
)

Creates a HashMultimap of the given key-value pair.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap containing the given map entries
ofAll
(Map<? extends K, ? extends V2>
A map
map
)

Returns a HashMultimap, from a source java.util.Map.

public <
The stream element type
T
,
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new Multimap
ofAll
(Stream<? extends T>
the source stream
stream
,
Function<? super T, ? extends K>
the key mapper
keyMapper
,
Function<? super T, ? extends V2>
the value mapper
valueMapper
)

Returns a HashMultimap, from entries mapped from stream.

public <
The stream element type
T
,
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new HashMultimap
ofAll
(Stream<? extends T>
the source stream
stream
,
Function<? super T, Tuple2<? extends K, ? extends V2>>
the entry mapper
entryMapper
)

Returns a HashMultimap, from entries mapped from stream.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new HashMultimap containing the given entries.
ofEntries
(Iterable<? extends Tuple2<? extends K, ? extends V2>>
Multimap entries
entries
)

Creates a HashMultimap of the given entries.

public final <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new HashMultimap containing the given entries.
ofEntries
(Tuple2<? extends K, ? extends V2>...
Multimap entries
entries
)

Creates a HashMultimap of the given entries.

public final <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A new HashMultimap containing the given entries.
ofEntries
(Map.Entry<? extends K, ? extends V2>...
Multimap entries
entries
)

Creates a HashMultimap of the given entries.

public <
The key type
K
,
The value type
V2 extends V
>
HashMultimap<K, V2>

Returns:

A HashMultimap consisting of elements f(0),f(1), ..., f(n - 1)
tabulate
(int
The number of elements in the HashMultimap
n
,
Function<? super Integer, ? extends Tuple2<? extends K, ? extends V2>>
The Function computing element values
f
)

Returns a HashMultimap containing n values of a given Function f over a range of integer values from 0 to n - 1.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

containerTypeback to summary
private final Multimap.ContainerType containerType
emptyContainerback to summary
private final AbstractMultimap.SerializableSupplier<Traversable<?>> emptyContainer

Constructor Detail

Builderback to summary
private Builder(Multimap.ContainerType containerType, AbstractMultimap.SerializableSupplier<Traversable<?>> emptyContainer)

Method Detail

collectorback to summary
public <K, V2 extends V> Collector<Tuple2<K, V2>, ArrayList<Tuple2<K, V2>>, Multimap<K, V2>> collector()

Returns a Collector which may be used in conjunction with java.util.stream.Stream#collect(Collector) to obtain a HashMultimap.

Parameters
<K>
The key type
<V2>
The value type
Returns:Collector<Tuple2<K, V2>, ArrayList<Tuple2<K, V2>>, Multimap<K, V2>>

A HashMultimap Collector.

emptyback to summary
public <K, V2 extends V> HashMultimap<K, V2> empty()

Returns the empty HashMultimap.

Parameters
<K>
The key type
<V2>
The value type
Returns:HashMultimap<K, V2>

A new empty HashMultimap.

fillback to summary
public <K, V2 extends V> HashMultimap<K, V2> fill(int n, Supplier<? extends Tuple2<? extends K, ? extends V2>> s)

Returns a HashMultimap containing n values supplied by a given Supplier s.

Parameters
<K>
The key type
<V2>
The value type
n:int

The number of elements in the HashMultimap

s:Supplier<? extends Tuple2<? extends K, ? extends V2>>

The Supplier computing element values

Returns:HashMultimap<K, V2>

A HashMultimap of size n, where each element contains the result supplied by s.

Annotations
@SuppressWarnings:unchecked
Exceptions
NullPointerException:
if s is null
fillback to summary
public <K, V2 extends V> HashMultimap<K, V2> fill(int n, Tuple2<? extends K, ? extends V2> element)

Returns a HashMultimap containing n times the given element

Parameters
<K>
The key type
<V2>
The value type
n:int

The number of elements in the HashMultimap

element:Tuple2<? extends K, ? extends V2>

The element

Returns:HashMultimap<K, V2>

A HashMultimap of size 1, where each element contains n values of element._2.

Annotations
@SuppressWarnings:unchecked
ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K key, V2 value)

Creates a HashMultimap of the given key-value pair.

Parameters
<K>
The key type
<V2>
The value type
key:K

a key for the map

value:V2

the value for key

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3, K k4, V2 v4)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

k4:K

a key for the map

v4:V2

the value for k4

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3, K k4, V2 v4, K k5, V2 v5)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

k4:K

a key for the map

v4:V2

the value for k4

k5:K

a key for the map

v5:V2

the value for k5

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3, K k4, V2 v4, K k5, V2 v5, K k6, V2 v6)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

k4:K

a key for the map

v4:V2

the value for k4

k5:K

a key for the map

v5:V2

the value for k5

k6:K

a key for the map

v6:V2

the value for k6

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3, K k4, V2 v4, K k5, V2 v5, K k6, V2 v6, K k7, V2 v7)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

k4:K

a key for the map

v4:V2

the value for k4

k5:K

a key for the map

v5:V2

the value for k5

k6:K

a key for the map

v6:V2

the value for k6

k7:K

a key for the map

v7:V2

the value for k7

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3, K k4, V2 v4, K k5, V2 v5, K k6, V2 v6, K k7, V2 v7, K k8, V2 v8)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

k4:K

a key for the map

v4:V2

the value for k4

k5:K

a key for the map

v5:V2

the value for k5

k6:K

a key for the map

v6:V2

the value for k6

k7:K

a key for the map

v7:V2

the value for k7

k8:K

a key for the map

v8:V2

the value for k8

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3, K k4, V2 v4, K k5, V2 v5, K k6, V2 v6, K k7, V2 v7, K k8, V2 v8, K k9, V2 v9)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

k4:K

a key for the map

v4:V2

the value for k4

k5:K

a key for the map

v5:V2

the value for k5

k6:K

a key for the map

v6:V2

the value for k6

k7:K

a key for the map

v7:V2

the value for k7

k8:K

a key for the map

v8:V2

the value for k8

k9:K

a key for the map

v9:V2

the value for k9

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(K k1, V2 v1, K k2, V2 v2, K k3, V2 v3, K k4, V2 v4, K k5, V2 v5, K k6, V2 v6, K k7, V2 v7, K k8, V2 v8, K k9, V2 v9, K k10, V2 v10)

Creates a HashMultimap of the given list of key-value pairs.

Parameters
<K>
The key type
<V2>
The value type
k1:K

a key for the map

v1:V2

the value for k1

k2:K

a key for the map

v2:V2

the value for k2

k3:K

a key for the map

v3:V2

the value for k3

k4:K

a key for the map

v4:V2

the value for k4

k5:K

a key for the map

v5:V2

the value for k5

k6:K

a key for the map

v6:V2

the value for k6

k7:K

a key for the map

v7:V2

the value for k7

k8:K

a key for the map

v8:V2

the value for k8

k9:K

a key for the map

v9:V2

the value for k9

k10:K

a key for the map

v10:V2

the value for k10

Returns:HashMultimap<K, V2>

A new Multimap containing the given entries

ofback to summary
public <K, V2 extends V> HashMultimap<K, V2> of(Tuple2<? extends K, ? extends V2> entry)

Creates a HashMultimap of the given key-value pair. Returns a singleton HashMultimap, i.e. a HashMultimap of one entry.

Parameters
<K>
The key type
<V2>
The value type
entry:Tuple2<? extends K, ? extends V2>

A tuple containing the key-value pair.

Returns:HashMultimap<K, V2>

A new HashMultimap containing the given entry.

ofAllback to summary
public <K, V2 extends V> HashMultimap<K, V2> ofAll(Map<? extends K, ? extends V2> map)

Returns a HashMultimap, from a source java.util.Map.

Parameters
<K>
The key type
<V2>
The value type
map:Map<? extends K, ? extends V2>

A map

Returns:HashMultimap<K, V2>

A new Multimap containing the given map entries

ofAllback to summary
public <T, K, V2 extends V> HashMultimap<K, V2> ofAll(Stream<? extends T> stream, Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V2> valueMapper)

Returns a HashMultimap, from entries mapped from stream.

Parameters
<T>
The stream element type
<K>
The key type
<V2>
The value type
stream:Stream<? extends T>

the source stream

keyMapper:Function<? super T, ? extends K>

the key mapper

valueMapper:Function<? super T, ? extends V2>

the value mapper

Returns:HashMultimap<K, V2>

A new Multimap

ofAllback to summary
public <T, K, V2 extends V> HashMultimap<K, V2> ofAll(Stream<? extends T> stream, Function<? super T, Tuple2<? extends K, ? extends V2>> entryMapper)

Returns a HashMultimap, from entries mapped from stream.

Parameters
<T>
The stream element type
<K>
The key type
<V2>
The value type
stream:Stream<? extends T>

the source stream

entryMapper:Function<? super T, Tuple2<? extends K, ? extends V2>>

the entry mapper

Returns:HashMultimap<K, V2>

A new HashMultimap

ofEntriesback to summary
public <K, V2 extends V> HashMultimap<K, V2> ofEntries(Iterable<? extends Tuple2<? extends K, ? extends V2>> entries)

Creates a HashMultimap of the given entries.

Parameters
<K>
The key type
<V2>
The value type
entries:Iterable<? extends Tuple2<? extends K, ? extends V2>>

Multimap entries

Returns:HashMultimap<K, V2>

A new HashMultimap containing the given entries.

ofEntriesback to summary
public final <K, V2 extends V> HashMultimap<K, V2> ofEntries(Tuple2<? extends K, ? extends V2>... entries)

Creates a HashMultimap of the given entries.

Parameters
<K>
The key type
<V2>
The value type
entries:Tuple2<? extends K, ? extends V2>[]

Multimap entries

Returns:HashMultimap<K, V2>

A new HashMultimap containing the given entries.

Annotations
@SafeVarargs
ofEntriesback to summary
public final <K, V2 extends V> HashMultimap<K, V2> ofEntries(Map.Entry<? extends K, ? extends V2>... entries)

Creates a HashMultimap of the given entries.

Parameters
<K>
The key type
<V2>
The value type
entries:Map.Entry<? extends K, ? extends V2>[]

Multimap entries

Returns:HashMultimap<K, V2>

A new HashMultimap containing the given entries.

Annotations
@SafeVarargs
tabulateback to summary
public <K, V2 extends V> HashMultimap<K, V2> tabulate(int n, Function<? super Integer, ? extends Tuple2<? extends K, ? extends V2>> f)

Returns a HashMultimap containing n values of a given Function f over a range of integer values from 0 to n - 1.

Parameters
<K>
The key type
<V2>
The value type
n:int

The number of elements in the HashMultimap

f:Function<? super Integer, ? extends Tuple2<? extends K, ? extends V2>>

The Function computing element values

Returns:HashMultimap<K, V2>

A HashMultimap consisting of elements f(0),f(1), ..., f(n - 1)

Annotations
@SuppressWarnings:unchecked
Exceptions
NullPointerException:
if f is null