Top Description Inners Fields Constructors Methods
com.google.common.collect

pack-priv Class ImmutableMapEntry<K, V>

extends ImmutableEntry<K, V>
Class Inheritance
Known Direct Subclasses
com.google.common.collect.ImmutableMapEntry.NonTerminalImmutableMapEntry
Annotations
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.collect.CollectPreconditions.checkEntryNotNull

Implementation of 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.

Author
Louis Wasserman

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Inherited from com.google.common.collect.ImmutableEntry:
keyvalue

Constructor Summary

AccessConstructor and Description
pack-priv
ImmutableMapEntry(K key, V value)

pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static <K, V> ImmutableMapEntry<K, V>[]
createEntryArray(int size)

Creates an ImmutableMapEntry array to hold parameterized entries.

pack-priv ImmutableMapEntry<K, V>
pack-priv ImmutableMapEntry<K, V>
pack-priv 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.

Inherited from com.google.common.collect.ImmutableEntry:
getKeygetValuesetValue

Constructor Detail

ImmutableMapEntryback to summary
pack-priv ImmutableMapEntry(K key, V value)
ImmutableMapEntryback to summary
pack-priv ImmutableMapEntry(ImmutableMapEntry<K, V> contents)

Method Detail

createEntryArrayback to summary
pack-priv static <K, V> ImmutableMapEntry<K, V>[] createEntryArray(int size)

Creates an ImmutableMapEntry array to hold parameterized entries. The result must never be upcast back to ImmutableMapEntry[] (or Object[], etc.), or allowed to escape the class.

The returned array has all its elements set to their initial null values. However, we don't declare it as @Nullable ImmutableMapEntry[] because our checker doesn't require newly created arrays to have a @Nullable element type even when they're created directly with new ImmutableMapEntry[...], so it seems silly to insist on that only here.

Annotations
@SuppressWarnings:unchecked
getNextInKeyBucketback to summary
pack-priv ImmutableMapEntry<K, V> getNextInKeyBucket()
Annotations
@CheckForNull
getNextInValueBucketback to summary
pack-priv ImmutableMapEntry<K, V> getNextInValueBucket()
Annotations
@CheckForNull
isReusableback to summary
pack-priv 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.

com.google.common.collect back to summary

pack-priv final Class ImmutableMapEntry.NonTerminalImmutableBiMapEntry<K, V>

extends ImmutableMapEntry.NonTerminalImmutableMapEntry<K, V>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final transient ImmutableMapEntry<K, V>

Constructor Summary

AccessConstructor and Description
pack-priv
NonTerminalImmutableBiMapEntry(K key, V value, ImmutableMapEntry<K, V> nextInKeyBucket, ImmutableMapEntry<K, V> nextInValueBucket)

Method Summary

Modifier and TypeMethod and Description
pack-priv ImmutableMapEntry<K, V>
Inherited from com.google.common.collect.ImmutableMapEntry.NonTerminalImmutableMapEntry:
getNextInKeyBucketisReusable

Field Detail

nextInValueBucketback to summary
private final transient ImmutableMapEntry<K, V> nextInValueBucket
Annotations
@CheckForNull

Constructor Detail

NonTerminalImmutableBiMapEntryback to summary
pack-priv NonTerminalImmutableBiMapEntry(K key, V value, ImmutableMapEntry<K, V> nextInKeyBucket, ImmutableMapEntry<K, V> nextInValueBucket)

Method Detail

getNextInValueBucketback to summary
pack-priv ImmutableMapEntry<K, V> getNextInValueBucket()

Overrides com.google.common.collect.ImmutableMapEntry.getNextInValueBucket.

Annotations
@Override
@CheckForNull
com.google.common.collect back to summary

pack-priv Class ImmutableMapEntry.NonTerminalImmutableMapEntry<K, V>

extends ImmutableMapEntry<K, V>
Class Inheritance
Known Direct Subclasses
com.google.common.collect.ImmutableMapEntry.NonTerminalImmutableBiMapEntry

Field Summary

Modifier and TypeField and Description
private final transient ImmutableMapEntry<K, V>

Constructor Summary

AccessConstructor and Description
pack-priv
NonTerminalImmutableMapEntry(K key, V value, ImmutableMapEntry<K, V> nextInKeyBucket)

Method Summary

Modifier and TypeMethod and Description
pack-priv final ImmutableMapEntry<K, V>
pack-priv final boolean
isReusable()

Overrides com.google.common.collect.ImmutableMapEntry.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.
Inherited from com.google.common.collect.ImmutableMapEntry:
createEntryArraygetNextInValueBucket

Field Detail

nextInKeyBucketback to summary
private final transient ImmutableMapEntry<K, V> nextInKeyBucket
Annotations
@CheckForNull

Constructor Detail

NonTerminalImmutableMapEntryback to summary
pack-priv NonTerminalImmutableMapEntry(K key, V value, ImmutableMapEntry<K, V> nextInKeyBucket)

Method Detail

getNextInKeyBucketback to summary
pack-priv final ImmutableMapEntry<K, V> getNextInKeyBucket()

Overrides com.google.common.collect.ImmutableMapEntry.getNextInKeyBucket.

Annotations
@Override
@CheckForNull
isReusableback to summary
pack-priv final boolean isReusable()

Overrides com.google.common.collect.ImmutableMapEntry.isReusable.

Doc from com.google.common.collect.ImmutableMapEntry.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.

Annotations
@Override