org.apache.commons.collections.map

Class AbstractSortedMapDecorator

Implemented Interfaces:
Map, SortedMap
Known Direct Subclasses:
DualTreeBidiMap.ViewMap, FixedSizeSortedMap, UnmodifiableSortedMap

public abstract class AbstractSortedMapDecorator
extends AbstractMapDecorator
implements SortedMap

Provides a base decorator that enables additional functionality to be added to a Map 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 set/collection 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.5 $ $Date: 2004/04/02 21:16:50 $
Author:
Stephen Colebourne
Since:
Commons Collections 3.0

Field Summary

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

map

Constructor Summary

AbstractSortedMapDecorator()
Constructor only used in deserialization, do not use otherwise.
AbstractSortedMapDecorator(SortedMap map)
Constructor that wraps (not copies).

Method Summary

Comparator
comparator()
Object
firstKey()
protected SortedMap
getSortedMap()
Gets the map being decorated.
SortedMap
headMap(Object toKey)
Object
lastKey()
SortedMap
subMap(Object fromKey, Object toKey)
SortedMap
tailMap(Object fromKey)

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

AbstractSortedMapDecorator

protected AbstractSortedMapDecorator()
Constructor only used in deserialization, do not use otherwise.
Since:
Commons Collections 3.1

AbstractSortedMapDecorator

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

Method Details

comparator

public Comparator comparator()

firstKey

public Object firstKey()

getSortedMap

protected SortedMap getSortedMap()
Gets the map being decorated.
Returns:
the decorated map

headMap

public SortedMap headMap(Object toKey)

lastKey

public Object lastKey()

subMap

public SortedMap subMap(Object fromKey,
                        Object toKey)

tailMap

public SortedMap tailMap(Object fromKey)

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