# Package org.apache.commons.collections4.bidimap

package org.apache.commons.collections4.bidimap
Implements the `BidiMap`, `OrderedBidiMap` and `SortedBidiMap` interfaces. A BidiMap is an extension to Map that allows keys and values to be looked up with equal ease. One example usage is a system communicating to a legacy datasource that must convert codes from the new format to the old format and vice versa.

The following implementations are provided in the package:

- DualHashBidiMap - uses two HashMaps to implement BidiMap
- DualLinkedHashBidiMap - uses two LinkedHashMaps to implement BidiMap
- DualTreeBidiMap - uses two TreeMaps to implement SortedBidiMap
- TreeBidiMap - red-black tree implementation of OrderedBidiMap

The following decorators are provided in the package:

- Unmodifiable - ensures the map cannot be altered

- Related Packages
  Package
  Description
  org.apache.commons.collections4
  Interfaces and utilities shared across all packages.
- Classes
  Class
  Description
  AbstractBidiMapDecorator<K,V>
  Provides a base decorator that enables additional functionality to be added to a BidiMap via decoration.
  AbstractDualBidiMap<K,V>
  Abstract `BidiMap` implemented using two maps.
  AbstractDualBidiMap.BidiMapIterator<K,V>
  Inner class MapIterator.
  AbstractDualBidiMap.EntrySet<K,V>
  Inner class EntrySet.
  AbstractDualBidiMap.EntrySetIterator<K,V>
  Inner class EntrySetIterator.
  AbstractDualBidiMap.KeySet<K>
  Inner class KeySet.
  AbstractDualBidiMap.KeySetIterator<K>
  Inner class KeySetIterator.
  AbstractDualBidiMap.MapEntry<K,V>
  Inner class MapEntry.
  AbstractDualBidiMap.Values<V>
  Inner class Values.
  AbstractDualBidiMap.ValuesIterator<V>
  Inner class ValuesIterator.
  AbstractDualBidiMap.View<K,V,E>
  Inner class View.
  AbstractOrderedBidiMapDecorator<K,V>
  Provides a base decorator that enables additional functionality to be added to an OrderedBidiMap via decoration.
  AbstractSortedBidiMapDecorator<K,V>
  Provides a base decorator that enables additional functionality to be added to a SortedBidiMap via decoration.
  DualHashBidiMap<K,V>
  Implements `BidiMap` with two `HashMap` instances.
  DualLinkedHashBidiMap<K,V>
  Implements `BidiMap` with two `LinkedHashMap` instances.
  DualTreeBidiMap<K,V>
  Implements `BidiMap` with two `TreeMap` instances.
  DualTreeBidiMap.BidiOrderedMapIterator<K,V>
  Inner class MapIterator.
  DualTreeBidiMap.ViewMap<K,V>
  Internal sorted map view.
  TreeBidiMap<K extends Comparable<K>,V extends Comparable<V>>
  Red-Black tree-based implementation of BidiMap where all objects added implement the `Comparable` interface.
  UnmodifiableBidiMap<K,V>
  Decorates another `BidiMap` to ensure it can't be altered.
  UnmodifiableOrderedBidiMap<K,V>
  Decorates another `OrderedBidiMap` to ensure it can't be altered.
  UnmodifiableSortedBidiMap<K,V>
  Decorates another `SortedBidiMap` to ensure it can't be altered.