Top Description Constructors Methods
org.apache.commons.collections4.bidimap

public abstract Class AbstractOrderedBidiMapDecorator<K, V>

extends AbstractBidiMapDecorator<K, V>
implements OrderedBidiMap<K, V>
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.OrderedBidiMap, 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, org.apache.commons.collections4.BidiMap
Known Direct Subclasses
org.apache.commons.collections4.bidimap.AbstractSortedBidiMapDecorator, org.apache.commons.collections4.bidimap.UnmodifiableOrderedBidiMap
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.OrderedBidiMap, .OrderedMapIterator

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

Constructor Summary

AccessConstructor and Description
protected
AbstractOrderedBidiMapDecorator(final OrderedBidiMap<K, V>
the map to decorate, must not be null
map
)

Constructor that wraps (not copies).

Method Summary

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

Returns:

the decorated map
decorated
()

Overrides org.apache.commons.collections4.bidimap.AbstractBidiMapDecorator.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 OrderedBidiMap<V, K>
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.bidimap.AbstractBidiMapDecorator:
getKeyremoveValuevalues

Constructor Detail

AbstractOrderedBidiMapDecoratorback to summary
protected AbstractOrderedBidiMapDecorator(final OrderedBidiMap<K, V> map)

Constructor that wraps (not copies).

Parameters
map:OrderedBidiMap<K, V>

the map to decorate, must not be null

Exceptions
NullPointerException:
if the collection is null

Method Detail

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

Overrides org.apache.commons.collections4.bidimap.AbstractBidiMapDecorator.decorated.

Gets the map being decorated.

Returns:OrderedBidiMap<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
inverseBidiMapback to summary
public OrderedBidiMap<V, K> inverseBidiMap()

Overrides org.apache.commons.collections4.bidimap.AbstractBidiMapDecorator.inverseBidiMap.

Implements org.apache.commons.collections4.OrderedBidiMap.inverseBidiMap, org.apache.commons.collections4.BidiMap.inverseBidiMap.

Doc from org.apache.commons.collections4.OrderedBidiMap.inverseBidiMap.

Gets a view of this map where the keys and values are reversed.

Changes to one map will be visible in the other and vice versa. This enables both directions of the map to be accessed equally.

Implementations should seek to avoid creating a new object every time this method is called. See AbstractMap.values() etc. Calling this method on the inverse map should return the original.

Implementations must return an OrderedBidiMap instance, usually by forwarding to inverseOrderedBidiMap().

Returns:OrderedBidiMap<V, K>

an inverted bidirectional 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.bidimap.AbstractBidiMapDecorator.mapIterator.

Implements org.apache.commons.collections4.IterableGet.mapIterator, org.apache.commons.collections4.OrderedMap.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