org.apache.commons.collections.bidimap
Class DualTreeBidiMap
- BidiMap, IterableMap, Map, OrderedBidiMap, OrderedMap, Serializable, SortedBidiMap, SortedMap
public class DualTreeBidiMap
Implementation of
BidiMap
that uses two
TreeMap
instances.
The setValue() method on iterators will succeed only if the new value being set is
not already in the bidimap.
When considering whether to use this class, the
TreeBidiMap
class should
also be considered. It implements the interface using a dedicated design, and does
not store each object twice, which can save on memory use.
NOTE: From Commons Collections 3.1, all subclasses will use
TreeMap
and the flawed
createMap
method is ignored.
$Id: DualTreeBidiMap.java,v 1.14 2004/06/11 23:27:37 scolebourne Exp $- Matthew Hawthorne
- Stephen Colebourne
protected Comparator | comparator - The comparator to use
|
DualTreeBidiMap() - Creates an empty
DualTreeBidiMap
|
DualTreeBidiMap(Comparator comparator) - Constructs a
DualTreeBidiMap using the specified Comparator.
|
DualTreeBidiMap(Map map) - Constructs a
DualTreeBidiMap and copies the mappings from
specified Map .
|
DualTreeBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap) - Constructs a
DualTreeBidiMap that decorates the specified maps.
|
clear , containsKey , containsValue , createBidiMap , createEntrySetIterator , createKeySetIterator , createMap , createValuesIterator , entrySet , equals , get , getKey , hashCode , inverseBidiMap , isEmpty , keySet , mapIterator , put , putAll , remove , removeValue , size , toString , values |
comparator
protected final Comparator comparator
The comparator to use
DualTreeBidiMap
public DualTreeBidiMap()
Creates an empty DualTreeBidiMap
DualTreeBidiMap
public DualTreeBidiMap(Comparator comparator)
Constructs a DualTreeBidiMap
using the specified Comparator.
comparator
- the Comparator
DualTreeBidiMap
public DualTreeBidiMap(Map map)
Constructs a DualTreeBidiMap
and copies the mappings from
specified Map
.
map
- the map whose mappings are to be placed in this map
DualTreeBidiMap
protected DualTreeBidiMap(Map normalMap,
Map reverseMap,
BidiMap inverseBidiMap)
Constructs a DualTreeBidiMap
that decorates the specified maps.
normalMap
- the normal direction mapreverseMap
- the reverse direction mapinverseBidiMap
- the inverse BidiMap
comparator
public Comparator comparator()
createBidiMap
protected BidiMap createBidiMap(Map normalMap,
Map reverseMap,
BidiMap inverseMap)
Creates a new instance of this object.
- createBidiMap in interface AbstractDualBidiMap
normalMap
- the normal direction mapreverseMap
- the reverse direction mapinverseMap
- the inverse BidiMap
headMap
public SortedMap headMap(Object toKey)
orderedMapIterator
public OrderedMapIterator orderedMapIterator()
Obtains an ordered map iterator.
This implementation copies the elements to an ArrayList in order to
provide the forward/backward behaviour.
- orderedMapIterator in interface OrderedMap
- a new ordered map iterator
subMap
public SortedMap subMap(Object fromKey,
Object toKey)
tailMap
public SortedMap tailMap(Object fromKey)
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.