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 |
(package 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) ImmutableSet<K> |
createKeySet() |
void |
forEach(java.util.function.BiConsumer<? super K,? super V> action) |
(package private) static <K,V> ImmutableBiMap<K,V> |
fromEntries(java.util.Map.Entry<K,V>... entries) |
(package private) static <K,V> ImmutableBiMap<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, builderWithExpectedSize, copyOf, copyOf, createValues, forcePut, of, of, of, of, of, of, of, of, of, of, of, ofEntries, toImmutableBiMap, values, writeReplacetoImmutableMap, toImmutableMapasMultimap, checkNoConflict, clear, compute, computeIfAbsent, computeIfPresent, conflictException, containsKey, containsValue, entryOf, entrySet, equals, getOrDefault, isEmpty, keyIterator, keySet, keySpliterator, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, toStringstatic final RegularImmutableBiMap<java.lang.Object,java.lang.Object> EMPTY
static final double MAX_LOAD_FACTOR
@CheckForNull private final transient ImmutableMapEntry<K,V>[] keyTable
@CheckForNull private final transient ImmutableMapEntry<K,V>[] valueTable
private final transient int mask
private final transient int hashCode
@CheckForNull private transient ImmutableBiMap<V,K> inverse
private RegularImmutableBiMap(@CheckForNull
ImmutableMapEntry<K,V>[] keyTable,
@CheckForNull
ImmutableMapEntry<K,V>[] valueTable,
java.util.Map.Entry<K,V>[] entries,
int mask,
int hashCode)
static <K,V> ImmutableBiMap<K,V> fromEntries(java.util.Map.Entry<K,V>... entries)
static <K,V> ImmutableBiMap<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,
@CheckForNull
ImmutableMapEntry<?,?> valueBucketHead)
throws RegularImmutableMap.BucketOverflowException
java.lang.IllegalArgumentException - if another entry in the bucket has the same keyRegularImmutableMap.BucketOverflowException - if this bucket has too many entries, which may indicate a hash
flooding attack@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 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()
ImmutableBiMapNote: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.