⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.map

Class AbstractSortedMapDecorator

java.lang.Object
|
+--org.apache.commons.collections.map.AbstractMapDecorator
   |
   +--org.apache.commons.collections.map.AbstractSortedMapDecorator

All 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.

Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

AbstractSortedMapDecorator(SortedMap map)

Constructor that wraps (not copies).

Method Summary

Comparator

comparator()

Object

firstKey()

SortedMap

getSortedMap()

Gets the map being decorated.

SortedMap

headMap(Object toKey)

Object

lastKey()

SortedMap

subMap(Object fromKey, Object toKey)

SortedMap

tailMap(Object fromKey)

Constructor Details

AbstractSortedMapDecorator

public AbstractSortedMapDecorator(SortedMap map)

Constructor that wraps (not copies).

Parameters:
map - the map to decorate, must not be null
Throws:
- if the collection is 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)

Parameters:
toKey

lastKey

public Object lastKey()


subMap

public SortedMap subMap(Object fromKey, Object toKey)

Parameters:
fromKey
toKey

tailMap

public SortedMap tailMap(Object fromKey)

Parameters:
fromKey