@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> |
private static class |
RegularImmutableBiMap.NonTerminalBiMapEntry<K,V> |
ImmutableBiMap.Builder<K,V>
Modifier and Type | Field and Description |
---|---|
private ImmutableMapEntry<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 |
Constructor and Description |
---|
RegularImmutableBiMap(ImmutableMapEntry.TerminalEntry<?,?>... entriesToAdd) |
RegularImmutableBiMap(int n,
ImmutableMapEntry.TerminalEntry<?,?>[] entriesToAdd)
Constructor for RegularImmutableBiMap that takes as input an array of
TerminalEntry
entries. |
RegularImmutableBiMap(java.util.Map.Entry<?,?>[] entriesToAdd)
Constructor for RegularImmutableBiMap that makes no assumptions about the input entries.
|
Modifier and Type | Method and Description |
---|---|
private static <K,V> ImmutableMapEntry<K,V>[] |
createEntryArray(int length) |
(package private) ImmutableSet<java.util.Map.Entry<K,V>> |
createEntrySet() |
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, copyOf, forcePut, of, of, of, of, of, of, values, writeReplace
asMultimap, checkNoConflict, clear, containsKey, containsValue, createKeySet, entryOf, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, toString
static final double MAX_LOAD_FACTOR
private final transient ImmutableMapEntry<K,V>[] keyTable
private final transient ImmutableMapEntry<K,V>[] valueTable
private final transient ImmutableMapEntry<K,V>[] entries
private final transient int mask
private final transient int hashCode
private transient ImmutableBiMap<V,K> inverse
RegularImmutableBiMap(ImmutableMapEntry.TerminalEntry<?,?>... entriesToAdd)
RegularImmutableBiMap(int n, ImmutableMapEntry.TerminalEntry<?,?>[] entriesToAdd)
TerminalEntry
entries. Assumes that these entries have already been checked for null.
This allows reuse of the entry objects from the array in the actual implementation.
RegularImmutableBiMap(java.util.Map.Entry<?,?>[] entriesToAdd)
private static <K,V> ImmutableMapEntry<K,V>[] createEntryArray(int length)
@Nullable public V get(@Nullable java.lang.Object key)
ImmutableSet<java.util.Map.Entry<K,V>> createEntrySet()
createEntrySet
in class ImmutableMap<K,V>
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
.