Top Description Fields Constructors Methods
org.apache.commons.collections4.bidimap

public Class DualLinkedHashBidiMap<K, V>

extends AbstractDualBidiMap<K, V>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Type Parameters
<K>
the type of the keys in the map
<V>
the type of the values in the map
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.util.LinkedHashMap, .Map, org.apache.commons.collections4.BidiMap

Implementation of BidiMap that uses two LinkedHashMap instances.

Two LinkedHashMap instances are used in this class. This provides fast lookups at the expense of storing two sets of map entries and two linked lists.

Since
4.0

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Ensure serialization compatibility

Inherited from org.apache.commons.collections4.bidimap.AbstractDualBidiMap:
entrySetinverseBidiMapkeySetnormalMapreverseMapvalues

Constructor Summary

AccessConstructor and Description
public
DualLinkedHashBidiMap()

Creates an empty HashBidiMap.

public
DualLinkedHashBidiMap(final Map<? extends K, ? extends V>
the map whose mappings are to be placed in this map
map
)

Constructs a LinkedHashBidiMap and copies the mappings from specified Map.

protected
DualLinkedHashBidiMap(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 LinkedHashBidiMap that decorates the specified maps.

Method Summary

Modifier and TypeMethod and Description
protected BidiMap<V, K>

Returns:

new bidi map
createBidiMap
(final Map<V, K>
the normal direction map
normalMap
,
final Map<K, V>
the reverse direction map
reverseMap
,
final BidiMap<K, V>
the inverse BidiMap
inverseBidiMap
)

Implements abstract org.apache.commons.collections4.bidimap.AbstractDualBidiMap.createBidiMap.

Creates a new instance of this object.
private void
private void
Inherited from org.apache.commons.collections4.bidimap.AbstractDualBidiMap:
clearcontainsKeycontainsValuecreateEntrySetIteratorcreateKeySetIteratorcreateValuesIteratorentrySetequalsgetgetKeyhashCodeinverseBidiMapisEmptykeySetmapIteratorputputAllremoveremoveValuesizetoStringvalues

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Ensure serialization compatibility

Constructor Detail

DualLinkedHashBidiMapback to summary
public DualLinkedHashBidiMap()

Creates an empty HashBidiMap.

DualLinkedHashBidiMapback to summary
public DualLinkedHashBidiMap(final Map<? extends K, ? extends V> map)

Constructs a LinkedHashBidiMap and copies the mappings from specified Map.

Parameters
map:Map<? extends K, ? extends V>

the map whose mappings are to be placed in this map

DualLinkedHashBidiMapback to summary
protected DualLinkedHashBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap)

Constructs a LinkedHashBidiMap that decorates the specified maps.

Parameters
normalMap:Map<K, V>

the normal direction map

reverseMap:Map<V, K>

the reverse direction map

inverseBidiMap:BidiMap<V, K>

the inverse BidiMap

Method Detail

createBidiMapback to summary
protected BidiMap<V, K> createBidiMap(final Map<V, K> normalMap, final Map<K, V> reverseMap, final BidiMap<K, V> inverseBidiMap)

Implements abstract org.apache.commons.collections4.bidimap.AbstractDualBidiMap.createBidiMap.

Creates a new instance of this object.

Parameters
normalMap:Map<V, K>

the normal direction map

reverseMap:Map<K, V>

the reverse direction map

inverseBidiMap:BidiMap<K, V>

the inverse BidiMap

Returns:BidiMap<V, K>

new bidi map

Annotations
@Override
readObjectback to summary
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
writeObjectback to summary
private void writeObject(final ObjectOutputStream out) throws IOException