Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Direct Known 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
Version:
  $Revision: 1.5 $ $Date: 2004/04/02 21:16:50 $
Author:
  Stephen Colebourne

Field Summary

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

Constructor Summary
`protected` | `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`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Map
`clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

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

### getSortedMap

    protected SortedMap getSortedMap()

  Gets the map being decorated.

  Returns:
    the decorated map

### comparator

    public Comparator comparator()

  Specified by:
    `comparator` in interface `SortedMap`

### firstKey

    public Object firstKey()

  Specified by:
    `firstKey` in interface `SortedMap`

### headMap

    public SortedMap headMap(Object toKey)

  Specified by:
    `headMap` in interface `SortedMap`

### lastKey

    public Object lastKey()

  Specified by:
    `lastKey` in interface `SortedMap`

### subMap

    public SortedMap subMap(Object fromKey,
                            Object toKey)

  Specified by:
    `subMap` in interface `SortedMap`

### tailMap

    public SortedMap tailMap(Object fromKey)

  Specified by:
    `tailMap` in interface `SortedMap`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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