BiMap backed by an EnumMap instance for keys-to-values, and a HashMap
instance for values-to-keys. Null keys are not permitted, but null values are. An EnumHashBiMap and its inverse are both serializable.
See the Guava User Guide article on BiMap.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv transient Class | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv K | checkKey(K key)
Returns its input, or throws an exception if this is not a valid key.
|
| public static <K extends Enum | |
| public static <K extends Enum | |
| public V | forcePut(K
the key with which the specified value is to be associated key, V the value to be associated with the specified key value)Overrides com. Implements com. put that silently removes any existing entry with the value value before proceeding with the put operation.
|
| public Class | |
| public V | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Overrides com. Implements com. |
| private void | |
| private void |
| keyTypeOrObjectUnderJ2cl | back to summary |
|---|---|
| pack-priv transient Class<K> keyTypeOrObjectUnderJ2cl | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| EnumHashBiMap | back to summary |
|---|---|
| private EnumHashBiMap(Class<K> keyType) | |
| checkKey | back to summary |
|---|---|
| pack-priv K checkKey(K key) Overrides com. Doc from com. Returns its input, or throws an exception if this is not a valid key.
| |
| create | back to summary |
|---|---|
| public static <K extends Enum Returns a new, empty
| |
| create | back to summary |
|---|---|
| public static <K extends Enum Constructs a new bimap with the same mappings as the specified map. If the specified map is an
| |
| forcePut | back to summary |
|---|---|
| public V forcePut(K key, V value) Overrides com. Implements com. Doc from com. An alternate form of Note that a successful call to this method could cause the size of the bimap to increase by one, stay the same, or even decrease by one. Warning If an existing entry with this value is removed, the key for that entry is discarded and not returned.
| |
| keyType | back to summary |
|---|---|
| public Class Returns the associated key type.
| |
| put | back to summary |
|---|---|
| public V put(K key, V value) Overrides com. Implements com. Doc from com. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
| |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream stream) throws IOException
| |