public class DualLinkedHashBidiMap<K,V> extends AbstractDualBidiMap<K,V> implements java.io.Serializable
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.
AbstractDualBidiMap.BidiMapIterator<K,V>, AbstractDualBidiMap.EntrySet<K,V>, AbstractDualBidiMap.EntrySetIterator<K,V>, AbstractDualBidiMap.KeySet<K>, AbstractDualBidiMap.KeySetIterator<K>, AbstractDualBidiMap.MapEntry<K,V>, AbstractDualBidiMap.Values<V>, AbstractDualBidiMap.ValuesIterator<V>, AbstractDualBidiMap.View<K,V,E>| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID
Ensure serialization compatibility
|
entrySet, inverseBidiMap, keySet, normalMap, reverseMap, values| Modifier | Constructor and Description |
|---|---|
|
DualLinkedHashBidiMap()
Creates an empty
HashBidiMap. |
|
DualLinkedHashBidiMap(java.util.Map<? extends K,? extends V> map)
Constructs a
LinkedHashBidiMap and copies the mappings from
specified Map. |
protected |
DualLinkedHashBidiMap(java.util.Map<K,V> normalMap,
java.util.Map<V,K> reverseMap,
BidiMap<V,K> inverseBidiMap)
Constructs a
LinkedHashBidiMap that decorates the specified maps. |
| Modifier and Type | Method and Description |
|---|---|
protected BidiMap<V,K> |
createBidiMap(java.util.Map<V,K> normalMap,
java.util.Map<K,V> reverseMap,
BidiMap<K,V> inverseBidiMap)
Creates a new instance of this object.
|
private void |
readObject(java.io.ObjectInputStream in) |
private void |
writeObject(java.io.ObjectOutputStream out) |
clear, containsKey, containsValue, createEntrySetIterator, createKeySetIterator, createValuesIterator, entrySet, equals, get, getKey, hashCode, inverseBidiMap, isEmpty, keySet, mapIterator, put, putAll, remove, removeValue, size, toString, valuesprivate static final long serialVersionUID
public DualLinkedHashBidiMap()
HashBidiMap.public DualLinkedHashBidiMap(java.util.Map<? extends K,? extends V> map)
LinkedHashBidiMap and copies the mappings from
specified Map.map - the map whose mappings are to be placed in this mapprotected DualLinkedHashBidiMap(java.util.Map<K,V> normalMap, java.util.Map<V,K> reverseMap, BidiMap<V,K> inverseBidiMap)
LinkedHashBidiMap that decorates the specified maps.normalMap - the normal direction mapreverseMap - the reverse direction mapinverseBidiMap - the inverse BidiMapprotected BidiMap<V,K> createBidiMap(java.util.Map<V,K> normalMap, java.util.Map<K,V> reverseMap, BidiMap<K,V> inverseBidiMap)
createBidiMap in class AbstractDualBidiMap<K,V>normalMap - the normal direction mapreverseMap - the reverse direction mapinverseBidiMap - the inverse BidiMapprivate void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
java.io.IOExceptionprivate void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundException