org.apache.commons.collections.map

Class AbstractSortedMapDecorator

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

Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $

Author: Stephen Colebourne

Constructor Summary
protected AbstractSortedMapDecorator()
Constructor only used in deserialization, do not use otherwise.
AbstractSortedMapDecorator(SortedMap map)
Constructor that wraps (not copies).
Method Summary
Comparatorcomparator()
ObjectfirstKey()
protected SortedMapgetSortedMap()
Gets the map being decorated.
SortedMapheadMap(Object toKey)
ObjectlastKey()
SortedMapsubMap(Object fromKey, Object toKey)
SortedMaptailMap(Object fromKey)

Constructor Detail

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

Throws: IllegalArgumentException if the collection is null

Method Detail

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-2008 Apache Software Foundation. All Rights Reserved.