Package com.google.common.collect
Class JdkBackedImmutableBiMap<K,V>
java.lang.Object
com.google.common.collect.ImmutableMap<K,V>
com.google.common.collect.ImmutableBiMap<K,V>
com.google.common.collect.JdkBackedImmutableBiMap<K,V>
- All Implemented Interfaces:
BiMap<K,,V> Serializable,Map<K,V>
Implementation of ImmutableBiMap backed by a pair of JDK HashMaps, which have smartness
protecting against hash flooding.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.google.common.collect.ImmutableBiMap
ImmutableBiMap.Builder<K,V> Nested classes/interfaces inherited from class com.google.common.collect.ImmutableMap
ImmutableMap.IteratorBasedImmutableMap<K,V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ImmutableList<Map.Entry<K, V>> private JdkBackedImmutableBiMap<V, K> Fields inherited from class com.google.common.collect.ImmutableMap
EMPTY_ENTRY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <K,V> ImmutableBiMap <K, V> (package private) ImmutableSet<Map.Entry<K, V>> (package private) ImmutableSet<K> inverse()Returns the inverse view of this bimap, which maps each of this bimap's values to its associated key.(package private) booleanintsize()(package private) ObjectReturns a serializable form of this object.Methods inherited from class com.google.common.collect.ImmutableBiMap
builder, builderWithExpectedSize, copyOf, copyOf, createValues, forcePut, of, of, of, of, of, of, of, of, of, of, of, ofEntries, toImmutableBiMap, toImmutableMap, toImmutableMap, valuesMethods inherited from class com.google.common.collect.ImmutableMap
asMultimap, checkNoConflict, clear, compute, computeIfAbsent, computeIfPresent, conflictException, containsKey, containsValue, entryOf, entrySet, equals, getOrDefault, hashCode, isEmpty, isHashCodeFast, keyIterator, keySet, keySpliterator, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, remove, replace, replace, replaceAll
-
Field Details
-
entries
-
forwardDelegate
-
backwardDelegate
-
inverse
-
-
Constructor Details
-
JdkBackedImmutableBiMap
-
-
Method Details
-
create
-
size
public int size() -
inverse
Description copied from class:ImmutableBiMapReturns the inverse view of this bimap, which maps each of this bimap's values to its associated key. The two bimaps are backed by the same data; any changes to one will appear in the other.Note:There is no guaranteed correspondence between the iteration order of a bimap and that of its inverse.
The inverse of an
ImmutableBiMapis anotherImmutableBiMap. -
get
-
createEntrySet
ImmutableSet<Map.Entry<K,V>> createEntrySet()- Specified by:
createEntrySetin classImmutableMap<K,V>
-
createKeySet
ImmutableSet<K> createKeySet()- Specified by:
createKeySetin classImmutableMap<K,V>
-
isPartialView
boolean isPartialView()- Specified by:
isPartialViewin classImmutableMap<K,V>
-
writeReplace
Object writeReplace()Description copied from class:ImmutableMapReturns a serializable form of this object. Non-public subclasses should not override this method. Publicly-accessible subclasses must override this method and should return a subclass of SerializedForm whose readResolve() method returns objects of the subclass type.- Overrides:
writeReplacein classImmutableBiMap<K,V>
-