Top Description Fields Constructors Methods
org.apache.commons.collections4.map

public abstract Class AbstractOrderedMapDecorator<K, V>

extends AbstractMapDecorator<K, V>
implements OrderedMap<K, V>
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.OrderedMap, org.apache.commons.collections4.IterableMap, org.apache.commons.collections4.IterableGet, org.apache.commons.collections4.Get, org.apache.commons.collections4.Put, java.util.Map
Known Direct Subclasses
org.apache.commons.collections4.map.UnmodifiableOrderedMap
Type Parameters
<K>
the type of the keys in this map
<V>
the type of the values in this map
Imports
org.apache.commons.collections4.OrderedMap, .OrderedMapIterator

Provides a base decorator that enables additional functionality to be added to an OrderedMap 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
3.0

Field Summary

Inherited from org.apache.commons.collections4.map.AbstractMapDecorator:
map

Constructor Summary

AccessConstructor and Description
protected
AbstractOrderedMapDecorator()

Constructor only used in deserialization, do not use otherwise.

public
AbstractOrderedMapDecorator(final OrderedMap<K, V>
the map to decorate, must not be null
map
)

Constructor that wraps (not copies).

Method Summary

Modifier and TypeMethod and Description
protected OrderedMap<K, V>

Returns:

the decorated map
decorated
()

Overrides org.apache.commons.collections4.map.AbstractMapDecorator.decorated.

Gets the map being decorated.
public K
firstKey()

Implements org.apache.commons.collections4.OrderedMap.firstKey.

Gets the first key currently in this map.
public K
lastKey()

Implements org.apache.commons.collections4.OrderedMap.lastKey.

Gets the last key currently in this map.
public OrderedMapIterator<K, V>
public K
nextKey(final K
the key to search for next from
key
)

Implements org.apache.commons.collections4.OrderedMap.nextKey.

Gets the next key after the one specified.
public K
previousKey(final K
the key to search for previous from
key
)

Implements org.apache.commons.collections4.OrderedMap.previousKey.

Gets the previous key before the one specified.
Inherited from org.apache.commons.collections4.map.AbstractMapDecorator:
clearcontainsKeycontainsValueentrySetequalsgethashCodeisEmptykeySetputputAllremovesizetoStringvalues

Constructor Detail

AbstractOrderedMapDecoratorback to summary
protected AbstractOrderedMapDecorator()

Constructor only used in deserialization, do not use otherwise.

Since
3.1
AbstractOrderedMapDecoratorback to summary
public AbstractOrderedMapDecorator(final OrderedMap<K, V> map)

Constructor that wraps (not copies).

Parameters
map:OrderedMap<K, V>

the map to decorate, must not be null

Exceptions
NullPointerException:
if the map is null

Method Detail

decoratedback to summary
protected OrderedMap<K, V> decorated()

Overrides org.apache.commons.collections4.map.AbstractMapDecorator.decorated.

Gets the map being decorated.

Returns:OrderedMap<K, V>

the decorated map

Annotations
@Override
firstKeyback to summary
public K firstKey()

Implements org.apache.commons.collections4.OrderedMap.firstKey.

Doc from org.apache.commons.collections4.OrderedMap.firstKey.

Gets the first key currently in this map.

Returns:K

the first key currently in this map

Annotations
@Override
lastKeyback to summary
public K lastKey()

Implements org.apache.commons.collections4.OrderedMap.lastKey.

Doc from org.apache.commons.collections4.OrderedMap.lastKey.

Gets the last key currently in this map.

Returns:K

the last key currently in this map

Annotations
@Override
mapIteratorback to summary
public OrderedMapIterator<K, V> mapIterator()

Overrides org.apache.commons.collections4.map.AbstractIterableMap.mapIterator.

Implements org.apache.commons.collections4.OrderedMap.mapIterator, org.apache.commons.collections4.IterableGet.mapIterator.

Doc from org.apache.commons.collections4.OrderedMap.mapIterator.

Obtains an OrderedMapIterator over the map.

A ordered map iterator is an efficient way of iterating over maps in both directions.

Returns:OrderedMapIterator<K, V>

a map iterator

Annotations
@Override
nextKeyback to summary
public K nextKey(final K key)

Implements org.apache.commons.collections4.OrderedMap.nextKey.

Doc from org.apache.commons.collections4.OrderedMap.nextKey.

Gets the next key after the one specified.

Parameters
key:K

the key to search for next from

Returns:K

the next key, null if no match or at end

Annotations
@Override
previousKeyback to summary
public K previousKey(final K key)

Implements org.apache.commons.collections4.OrderedMap.previousKey.

Doc from org.apache.commons.collections4.OrderedMap.previousKey.

Gets the previous key before the one specified.

Parameters
key:K

the key to search for previous from

Returns:K

the previous key, null if no match or at start

Annotations
@Override