@GwtIncompatible class ImmutableMapEntry<K,V> extends ImmutableEntry<K,V>
Entry
for ImmutableMap
that adds extra methods to traverse hash
buckets for the key and the value. This allows reuse in RegularImmutableMap
and RegularImmutableBiMap
, which don't have to recopy the entries created by their Builder
implementations.
This base implementation has no key or value pointers, so instances of ImmutableMapEntry (but not its subclasses) can be reused when copied from one ImmutableMap to another.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ImmutableMapEntry.NonTerminalImmutableBiMapEntry<K,V> |
(package private) static class |
ImmutableMapEntry.NonTerminalImmutableMapEntry<K,V> |
key, value
Constructor and Description |
---|
ImmutableMapEntry(ImmutableMapEntry<K,V> contents) |
ImmutableMapEntry(K key,
V value) |
Modifier and Type | Method and Description |
---|---|
(package private) static <K,V> ImmutableMapEntry<K,V>[] |
createEntryArray(int size)
Creates an
ImmutableMapEntry array to hold parameterized entries. |
(package private) ImmutableMapEntry<K,V> |
getNextInKeyBucket() |
(package private) ImmutableMapEntry<K,V> |
getNextInValueBucket() |
(package private) boolean |
isReusable()
Returns true if this entry has no bucket links and can safely be reused as a terminal entry in
a bucket in another map.
|
getKey, getValue, setValue
equals, hashCode, toString
ImmutableMapEntry(ImmutableMapEntry<K,V> contents)
static <K,V> 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.ImmutableMapEntry<K,V> getNextInKeyBucket()
ImmutableMapEntry<K,V> getNextInValueBucket()
boolean isReusable()