BidiMap that uses two HashMap instances.
Two HashMap instances are used in this class.
This provides fast lookups at the expense of storing two sets of map entries.
Commons Collections would welcome the addition of a direct hash-based
implementation of the BidiMap interface.
Note
From Commons Collections 3.1, all subclasses will use HashMap
and the flawed createMap method is ignored.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Ensure serialization compatibility |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DualHashBidiMap(final Map<? extends K, ? extends V>
the map whose mappings are to be placed in this map map)Constructs a |
| protected | DualHashBidiMap(final Map<K, V>
the normal direction map normalMap, final Map<V, K> the reverse direction map reverseMap, final BidiMap<V, K> the inverse BidiMap inverseBidiMap)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| protected BidiMap | Returns: new bidi mapthe normal direction map normalMap, final Map<K, V> the reverse direction map reverseMap, final BidiMap<K, V> the inverse BidiMap inverseBidiMap)Implements abstract org. |
| private void | |
| private void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Ensure serialization compatibility | |
| DualHashBidiMap | back to summary |
|---|---|
| public DualHashBidiMap() Creates an empty | |
| DualHashBidiMap | back to summary |
|---|---|
| public DualHashBidiMap(final Map<? extends K, ? extends V> map) Constructs a
| |
| DualHashBidiMap | back to summary |
|---|---|
| protected DualHashBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap) Constructs a | |
| createBidiMap | back to summary |
|---|---|
| protected BidiMap Implements abstract org. Creates a new instance of this object. | |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException | |
| writeObject | back to summary |
|---|---|
| private void writeObject(final ObjectOutputStream out) throws IOException | |