⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.bidimap

Class DualHashBidiMap

java.lang.Object
|
+--org.apache.commons.collections.bidimap.AbstractDualBidiMap
   |
   +--org.apache.commons.collections.bidimap.DualHashBidiMap

All Implemented Interfaces:
BidiMap, Serializable


public class DualHashBidiMap
extends AbstractDualBidiMap
implements Serializable

Implementation of BidiMap that uses two HashMap instances.
Since:
Commons Collections 3.0
Authors:
Matthew Hawthorne
Stephen Colebourne

Constructor Summary

DualHashBidiMap()

Creates an empty HashBidiMap

DualHashBidiMap(Map map)

Constructs a HashBidiMap and copies the mappings from specified Map.

DualHashBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap)

Constructs a HashBidiMap that decorates the specified maps.

Method Summary

BidiMap

createBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap)

Creates a new instance of this object.

Map

createMap()

Creates a new instance of the map used by the subclass to store data.

Constructor Details

DualHashBidiMap

public DualHashBidiMap()

Creates an empty HashBidiMap


DualHashBidiMap

protected DualHashBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap)

Constructs a HashBidiMap that decorates the specified maps.

Parameters:
normalMap - the normal direction map
reverseMap - the reverse direction map
inverseBidiMap - the inverse BidiMap

DualHashBidiMap

public DualHashBidiMap(Map map)

Constructs a HashBidiMap and copies the mappings from specified Map.

Parameters:
map - the map whose mappings are to be placed in this map

Method Details

createBidiMap

protected BidiMap createBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap)

Creates a new instance of this object.

Parameters:
normalMap - the normal direction map
reverseMap - the reverse direction map
inverseBidiMap - the inverse BidiMap
Returns:
new bidi map

createMap

protected Map createMap()

Creates a new instance of the map used by the subclass to store data.

Returns:
the map to be used for internal storage