final class JdkBackedImmutableBiMap<K,V> extends ImmutableBiMap<K,V>
Modifier and Type | Class and Description |
---|---|
private class |
JdkBackedImmutableBiMap.InverseEntries |
ImmutableBiMap.Builder<K,V>
ImmutableMap.IteratorBasedImmutableMap<K,V>
Modifier and Type | Field and Description |
---|---|
private java.util.Map<V,K> |
backwardDelegate |
private ImmutableList<java.util.Map.Entry<K,V>> |
entries |
private java.util.Map<K,V> |
forwardDelegate |
private JdkBackedImmutableBiMap<V,K> |
inverse |
EMPTY_ENTRY_ARRAY
Modifier | Constructor and Description |
---|---|
private |
JdkBackedImmutableBiMap(ImmutableList<java.util.Map.Entry<K,V>> entries,
java.util.Map<K,V> forwardDelegate,
java.util.Map<V,K> backwardDelegate) |
Modifier and Type | Method and Description |
---|---|
(package private) static <K,V> ImmutableBiMap<K,V> |
create(int n,
java.util.Map.Entry<K,V>[] entryArray) |
(package private) ImmutableSet<java.util.Map.Entry<K,V>> |
createEntrySet() |
(package private) ImmutableSet<K> |
createKeySet() |
V |
get(java.lang.Object key) |
ImmutableBiMap<V,K> |
inverse()
Returns the inverse view of this bimap, which maps each of this bimap's values to its
associated key.
|
(package private) boolean |
isPartialView() |
int |
size() |
builder, builderWithExpectedSize, copyOf, copyOf, createValues, forcePut, of, of, of, of, of, of, of, of, of, of, of, ofEntries, toImmutableBiMap, values, writeReplace
toImmutableMap, toImmutableMap
asMultimap, checkNoConflict, clear, compute, computeIfAbsent, computeIfPresent, conflictException, containsKey, containsValue, entryOf, entrySet, equals, getOrDefault, hashCode, isEmpty, isHashCodeFast, keyIterator, keySet, keySpliterator, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, toString
private final transient ImmutableList<java.util.Map.Entry<K,V>> entries
@CheckForNull private transient JdkBackedImmutableBiMap<V,K> inverse
static <K,V> ImmutableBiMap<K,V> create(int n, java.util.Map.Entry<K,V>[] entryArray)
public int size()
public ImmutableBiMap<V,K> inverse()
ImmutableBiMap
Note:There is no guaranteed correspondence between the iteration order of a bimap and that of its inverse.
The inverse of an ImmutableBiMap
is another ImmutableBiMap
.
@CheckForNull public V get(@CheckForNull java.lang.Object key)
ImmutableSet<java.util.Map.Entry<K,V>> createEntrySet()
createEntrySet
in class ImmutableMap<K,V>
ImmutableSet<K> createKeySet()
createKeySet
in class ImmutableMap<K,V>
boolean isPartialView()
isPartialView
in class ImmutableMap<K,V>