@GwtCompatible(serializable=true, emulated=true) final class SingletonImmutableBiMap<K,V> extends ImmutableBiMap<K,V>
ImmutableMap
with exactly one entry.ImmutableBiMap.Builder<K,V>
ImmutableMap.IteratorBasedImmutableMap<K,V>
Modifier and Type | Field and Description |
---|---|
(package private) ImmutableBiMap<V,K> |
inverse |
(package private) K |
singleKey |
(package private) V |
singleValue |
EMPTY_ENTRY_ARRAY
Modifier | Constructor and Description |
---|---|
(package private) |
SingletonImmutableBiMap(K singleKey,
V singleValue) |
private |
SingletonImmutableBiMap(K singleKey,
V singleValue,
ImmutableBiMap<V,K> inverse) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
(package private) ImmutableSet<java.util.Map.Entry<K,V>> |
createEntrySet() |
(package private) ImmutableSet<K> |
createKeySet() |
V |
get(java.lang.Object key) |
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 |
isPartialView() |
int |
size() |
builder, copyOf, copyOf, forcePut, of, of, of, of, of, of, values, writeReplace
asMultimap, checkNoConflict, clear, createValues, entryOf, entrySet, equals, hashCode, isEmpty, isHashCodeFast, keyIterator, keySet, put, putAll, remove, toString
final transient K singleKey
final transient V singleValue
transient ImmutableBiMap<V,K> inverse
private SingletonImmutableBiMap(K singleKey, V singleValue, ImmutableBiMap<V,K> inverse)
public V get(@Nullable java.lang.Object key)
public int size()
public boolean containsKey(@Nullable java.lang.Object key)
containsKey
in interface java.util.Map<K,V>
containsKey
in class ImmutableMap<K,V>
public boolean containsValue(@Nullable java.lang.Object value)
containsValue
in interface java.util.Map<K,V>
containsValue
in class ImmutableMap<K,V>
boolean isPartialView()
isPartialView
in class ImmutableMap<K,V>
ImmutableSet<java.util.Map.Entry<K,V>> createEntrySet()
createEntrySet
in class ImmutableMap<K,V>
ImmutableSet<K> createKeySet()
createKeySet
in class ImmutableMap<K,V>
public ImmutableBiMap<V,K> inverse()
ImmutableBiMap
Note: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
.