public class DualHashBidiMap extends AbstractDualBidiMap implements Serializable
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.
AbstractDualBidiMap.BidiMapIterator, AbstractDualBidiMap.EntrySet, AbstractDualBidiMap.EntrySetIterator, AbstractDualBidiMap.KeySet, AbstractDualBidiMap.KeySetIterator, AbstractDualBidiMap.MapEntry, AbstractDualBidiMap.Values, AbstractDualBidiMap.ValuesIterator, AbstractDualBidiMap.View
entrySet, inverseBidiMap, keySet, maps, values
Modifier | Constructor and Description |
---|---|
|
DualHashBidiMap()
Creates an empty
HashBidiMap . |
|
DualHashBidiMap(Map map)
Constructs a
HashBidiMap and copies the mappings from
specified Map . |
protected |
DualHashBidiMap(Map normalMap,
Map reverseMap,
BidiMap inverseBidiMap)
Constructs a
HashBidiMap that decorates the specified maps. |
Modifier and Type | Method and Description |
---|---|
protected BidiMap |
createBidiMap(Map normalMap,
Map reverseMap,
BidiMap inverseBidiMap)
Creates a new instance of this object.
|
clear, containsKey, containsValue, createEntrySetIterator, createKeySetIterator, createMap, createValuesIterator, entrySet, equals, get, getKey, hashCode, inverseBidiMap, isEmpty, keySet, mapIterator, put, putAll, remove, removeValue, size, toString, values
public DualHashBidiMap()
HashBidiMap
.public DualHashBidiMap(Map map)
HashBidiMap
and copies the mappings from
specified Map
.map
- the map whose mappings are to be placed in this mapprotected BidiMap createBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap)
createBidiMap
in class AbstractDualBidiMap
normalMap
- the normal direction mapreverseMap
- the reverse direction mapinverseBidiMap
- the inverse BidiMapCopyright © 2001–2015 The Apache Software Foundation. All rights reserved.