Package | Description |
---|---|
com.google.common.collect |
This package contains generic collection interfaces and implementations, and other utilities for
working with collections.
|
com.google.common.testing |
This package contains testing utilities.
|
Modifier and Type | Class and Description |
---|---|
(package private) class |
JdkBackedImmutableBiMap<K,V>
Implementation of ImmutableBiMap backed by a pair of JDK HashMaps, which have smartness
protecting against hash flooding.
|
(package private) class |
RegularImmutableBiMap<K,V>
Bimap with zero or more mappings.
|
private class |
RegularImmutableBiMap.Inverse |
(package private) class |
SingletonImmutableBiMap<K,V>
Implementation of
ImmutableMap with exactly one entry. |
Modifier and Type | Field and Description |
---|---|
private ImmutableBiMap<K,V> |
RegularImmutableBiMap.InverseSerializedForm.forward |
private ImmutableBiMap<V,K> |
RegularImmutableBiMap.inverse |
private ImmutableBiMap<V,K> |
SingletonImmutableBiMap.inverse |
private ImmutableBiMap<V,K> |
SingletonImmutableBiMap.lazyInverse |
Modifier and Type | Method and Description |
---|---|
ImmutableBiMap<K,V> |
ImmutableBiMap.Builder.build()
Returns a newly-created immutable bimap.
|
(package private) ImmutableBiMap<K,V> |
ImmutableBiMap.Builder.buildJdkBacked() |
ImmutableBiMap<K,V> |
ImmutableBiMap.Builder.buildKeepingLast()
Deprecated.
This method does not make sense for bimaps and should not be called.
|
ImmutableBiMap<K,V> |
ImmutableBiMap.Builder.buildOrThrow()
Returns a newly-created immutable bimap, or throws an exception if any key or value was added
more than once.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.copyOf(java.lang.Iterable<? extends java.util.Map.Entry<? extends K,? extends V>> entries)
Returns an immutable bimap containing the given entries.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.copyOf(java.util.Map<? extends K,? extends V> map)
Returns an immutable bimap containing the same entries as
map . |
(package private) static <K,V> ImmutableBiMap<K,V> |
JdkBackedImmutableBiMap.create(int n,
java.util.Map.Entry<K,V>[] entryArray) |
(package private) static <K,V> ImmutableBiMap<K,V> |
RegularImmutableBiMap.fromEntries(java.util.Map.Entry<K,V>... entries) |
(package private) static <K,V> ImmutableBiMap<K,V> |
RegularImmutableBiMap.fromEntryArray(int n,
java.util.Map.Entry<K,V>[] entryArray) |
ImmutableBiMap<V,K> |
JdkBackedImmutableBiMap.inverse() |
abstract ImmutableBiMap<V,K> |
ImmutableBiMap.inverse()
Returns the inverse view of this bimap, which maps each of this bimap's values to its
associated key.
|
ImmutableBiMap<V,K> |
RegularImmutableBiMap.inverse() |
ImmutableBiMap<K,V> |
RegularImmutableBiMap.Inverse.inverse() |
ImmutableBiMap<V,K> |
SingletonImmutableBiMap.inverse() |
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of()
Returns the empty bimap.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1)
Returns an immutable bimap containing a single entry.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9,
K k10,
V v10)
Returns an immutable map containing the given entries, in order.
|
static <K,V> ImmutableBiMap<K,V> |
ImmutableBiMap.ofEntries(java.util.Map.Entry<? extends K,? extends V>... entries)
Returns an immutable map containing the given entries, in order.
|
Modifier and Type | Method and Description |
---|---|
(package private) static <T,K,V> java.util.stream.Collector<T,?,ImmutableBiMap<K,V>> |
CollectCollectors.toImmutableBiMap(java.util.function.Function<? super T,? extends K> keyFunction,
java.util.function.Function<? super T,? extends V> valueFunction) |
static <T,K,V> java.util.stream.Collector<T,?,ImmutableBiMap<K,V>> |
ImmutableBiMap.toImmutableBiMap(java.util.function.Function<? super T,? extends K> keyFunction,
java.util.function.Function<? super T,? extends V> valueFunction)
Returns a
Collector that accumulates elements into an ImmutableBiMap whose keys
and values are the result of applying the provided mapping functions to the input elements. |
Constructor and Description |
---|
InverseSerializedForm(ImmutableBiMap<K,V> forward) |
SerializedForm(ImmutableBiMap<K,V> bimap) |
SingletonImmutableBiMap(K singleKey,
V singleValue,
ImmutableBiMap<V,K> inverse) |
Modifier and Type | Method and Description |
---|---|
(package private) static <K,V> ImmutableBiMap<K,V> |
FreshValueGenerator.generateImmutableBimap(K key,
V value) |