org.apache.commons.collections.bidimap

Class AbstractSortedBidiMapDecorator

Implemented Interfaces:
BidiMap, IterableMap, Map, OrderedBidiMap, OrderedMap, SortedBidiMap, SortedMap
Known Direct Subclasses:
UnmodifiableSortedBidiMap

public abstract class AbstractSortedBidiMapDecorator
extends AbstractOrderedBidiMapDecorator
implements SortedBidiMap

Provides a base decorator that enables additional functionality to be added to a SortedBidiMap via decoration.

Methods are forwarded directly to the decorated map.

This implementation does not perform any special processing with the map views. Instead it simply returns the inverse from the wrapped map. This may be undesirable, for example if you are trying to write a validating implementation it would provide a loophole around the validation. But, you might want that loophole, so this class is kept simple.

Version:
$Revision: 1.4 $ $Date: 2004/02/18 00:57:39 $
Author:
Stephen Colebourne
Since:
Commons Collections 3.0

Field Summary

Fields inherited from class org.apache.commons.collections.map.AbstractMapDecorator

map

Constructor Summary

AbstractSortedBidiMapDecorator(SortedBidiMap map)
Constructor that wraps (not copies).

Method Summary

Comparator
comparator()
protected SortedBidiMap
getSortedBidiMap()
Gets the map being decorated.
SortedMap
headMap(Object toKey)
SortedBidiMap
inverseSortedBidiMap()
SortedMap
subMap(Object fromKey, Object toKey)
SortedMap
tailMap(Object fromKey)

Methods inherited from class org.apache.commons.collections.bidimap.AbstractOrderedBidiMapDecorator

firstKey, getOrderedBidiMap, inverseOrderedBidiMap, lastKey, nextKey, orderedMapIterator, previousKey

Methods inherited from class org.apache.commons.collections.bidimap.AbstractBidiMapDecorator

getBidiMap, getKey, inverseBidiMap, mapIterator, removeValue

Methods inherited from class org.apache.commons.collections.map.AbstractMapDecorator

clear, containsKey, containsValue, entrySet, equals, get, getMap, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values

Constructor Details

AbstractSortedBidiMapDecorator

public AbstractSortedBidiMapDecorator(SortedBidiMap map)
Constructor that wraps (not copies).
Parameters:
map - the map to decorate, must not be null

Method Details

comparator

public Comparator comparator()

getSortedBidiMap

protected SortedBidiMap getSortedBidiMap()
Gets the map being decorated.
Returns:
the decorated map

headMap

public SortedMap headMap(Object toKey)

inverseSortedBidiMap

public SortedBidiMap inverseSortedBidiMap()
Specified by:
inverseSortedBidiMap in interface SortedBidiMap

subMap

public SortedMap subMap(Object fromKey,
                        Object toKey)

tailMap

public SortedMap tailMap(Object fromKey)

Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.