@GwtCompatible(serializable=true, emulated=true) class RegularImmutableBiMap<K,V> extends ImmutableBiMap<K,V>
Modifier and Type | Class and Description |
---|---|
private class |
RegularImmutableBiMap.Inverse |
private static class |
RegularImmutableBiMap.InverseSerializedForm<K,V> |
ImmutableBiMap.Builder<K,V>
ImmutableMap.IteratorBasedImmutableMap<K,V>
Modifier and Type | Field and Description |
---|---|
(package private) static RegularImmutableBiMap<java.lang.Object,java.lang.Object> |
EMPTY |
private java.util.Map.Entry<K,V>[] |
entries |
private int |
hashCode |
private ImmutableBiMap<V,K> |
inverse |
private ImmutableMapEntry<K,V>[] |
keyTable |
private int |
mask |
(package private) static double |
MAX_LOAD_FACTOR |
private ImmutableMapEntry<K,V>[] |
valueTable |
EMPTY_ENTRY_ARRAY
Modifier | Constructor and Description |
---|---|
private |
RegularImmutableBiMap(ImmutableMapEntry<K,V>[] keyTable,
ImmutableMapEntry<K,V>[] valueTable,
java.util.Map.Entry<K,V>[] entries,
int mask,
int hashCode) |
Modifier and Type | Method and Description |
---|---|
private static void |
checkNoConflictInValueBucket(java.lang.Object value,
java.util.Map.Entry<?,?> entry,
ImmutableMapEntry<?,?> valueBucketHead) |
(package private) ImmutableSet<java.util.Map.Entry<K,V>> |
createEntrySet() |
(package private) static <K,V> RegularImmutableBiMap<K,V> |
fromEntries(java.util.Map.Entry<K,V>... entries) |
(package private) static <K,V> RegularImmutableBiMap<K,V> |
fromEntryArray(int n,
java.util.Map.Entry<K,V>[] entryArray) |
V |
get(java.lang.Object key) |
int |
hashCode() |
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 |
isHashCodeFast() |
(package private) boolean |
isPartialView() |
int |
size() |
builder, copyOf, copyOf, forcePut, of, of, of, of, of, of, values, writeReplace
asMultimap, checkNoConflict, clear, containsKey, containsValue, createKeySet, createValues, entryOf, entrySet, equals, isEmpty, keyIterator, keySet, put, putAll, remove, toString
static final RegularImmutableBiMap<java.lang.Object,java.lang.Object> EMPTY
static final double MAX_LOAD_FACTOR
private final transient ImmutableMapEntry<K,V>[] keyTable
private final transient ImmutableMapEntry<K,V>[] valueTable
private final transient int mask
private final transient int hashCode
private transient ImmutableBiMap<V,K> inverse
private RegularImmutableBiMap(ImmutableMapEntry<K,V>[] keyTable, ImmutableMapEntry<K,V>[] valueTable, java.util.Map.Entry<K,V>[] entries, int mask, int hashCode)
static <K,V> RegularImmutableBiMap<K,V> fromEntries(java.util.Map.Entry<K,V>... entries)
static <K,V> RegularImmutableBiMap<K,V> fromEntryArray(int n, java.util.Map.Entry<K,V>[] entryArray)
private static void checkNoConflictInValueBucket(java.lang.Object value, java.util.Map.Entry<?,?> entry, @Nullable ImmutableMapEntry<?,?> valueBucketHead)
@Nullable public V get(@Nullable java.lang.Object key)
ImmutableSet<java.util.Map.Entry<K,V>> createEntrySet()
createEntrySet
in class ImmutableMap<K,V>
boolean isHashCodeFast()
isHashCodeFast
in class ImmutableMap<K,V>
public int hashCode()
boolean isPartialView()
isPartialView
in class ImmutableMap<K,V>
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
.