@GwtCompatible(serializable=true, emulated=true) final class RegularImmutableMap<K,V> extends ImmutableMap<K,V>
ImmutableMap
with two or more entries.Modifier and Type | Class and Description |
---|---|
private class |
RegularImmutableMap.EntrySet |
private static class |
RegularImmutableMap.NonTerminalMapEntry<K,V> |
ImmutableMap.Builder<K,V>, ImmutableMap.SerializedForm
Modifier and Type | Field and Description |
---|---|
private ImmutableMapEntry<K,V>[] |
entries |
private int |
mask |
private static double |
MAX_LOAD_FACTOR
Closed addressing tends to perform well even with high load factors.
|
private static long |
serialVersionUID |
private ImmutableMapEntry<K,V>[] |
table |
Constructor and Description |
---|
RegularImmutableMap(ImmutableMapEntry.TerminalEntry<?,?>... theEntries) |
RegularImmutableMap(int size,
ImmutableMapEntry.TerminalEntry<?,?>[] theEntries)
Constructor for RegularImmutableMap that takes as input an array of
TerminalEntry
entries. |
RegularImmutableMap(java.util.Map.Entry<?,?>[] theEntries)
Constructor for RegularImmutableMap that makes no assumptions about the input entries.
|
Modifier and Type | Method and Description |
---|---|
private void |
checkNoConflictInBucket(K key,
ImmutableMapEntry<K,V> entry,
ImmutableMapEntry<K,V> bucketHead) |
private ImmutableMapEntry<K,V>[] |
createEntryArray(int size)
Creates an
ImmutableMapEntry array to hold parameterized entries. |
(package private) ImmutableSet<java.util.Map.Entry<K,V>> |
createEntrySet() |
V |
get(java.lang.Object key) |
(package private) boolean |
isPartialView() |
int |
size() |
asMultimap, builder, checkNoConflict, clear, containsKey, containsValue, copyOf, createKeySet, entryOf, entrySet, equals, hashCode, isEmpty, keySet, of, of, of, of, of, of, put, putAll, remove, toString, values, writeReplace
private final transient ImmutableMapEntry<K,V>[] entries
private final transient ImmutableMapEntry<K,V>[] table
private final transient int mask
private static final double MAX_LOAD_FACTOR
private static final long serialVersionUID
RegularImmutableMap(ImmutableMapEntry.TerminalEntry<?,?>... theEntries)
RegularImmutableMap(int size, ImmutableMapEntry.TerminalEntry<?,?>[] theEntries)
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.
RegularImmutableMap(java.util.Map.Entry<?,?>[] theEntries)
private void checkNoConflictInBucket(K key, ImmutableMapEntry<K,V> entry, ImmutableMapEntry<K,V> bucketHead)
private ImmutableMapEntry<K,V>[] createEntryArray(int size)
ImmutableMapEntry
array to hold parameterized entries. The
result must never be upcast back to ImmutableMapEntry[] (or Object[], etc.), or
allowed to escape the class.public V get(@Nullable java.lang.Object key)
public int size()
boolean isPartialView()
isPartialView
in class ImmutableMap<K,V>
ImmutableSet<java.util.Map.Entry<K,V>> createEntrySet()
createEntrySet
in class ImmutableMap<K,V>