Top Description Methods
org.apache.commons.collections4

public Interface OrderedMap<K, V>

extends IterableMap<K, V>
Known Direct Subinterfaces
org.apache.commons.collections4.IterableSortedMap, org.apache.commons.collections4.OrderedBidiMap
Known Direct Implementers
org.apache.commons.collections4.map.AbstractLinkedMap, org.apache.commons.collections4.map.AbstractOrderedMapDecorator, org.apache.commons.collections4.map.ListOrderedMap, org.apache.commons.collections4.map.SingletonMap
Type Parameters
<K>
the type of the keys in the map
<V>
the type of the values in the map

Defines a map that maintains order and allows both forward and backward iteration through that order.
Since
3.0

Method Summary

Modifier and TypeMethod and Description
public K

Returns:

the first key currently in this map
firstKey
()

Gets the first key currently in this map.

public K

Returns:

the last key currently in this map
lastKey
()

Gets the last key currently in this map.

public OrderedMapIterator<K, V>

Returns:

a map iterator
mapIterator
()

Redeclares org.apache.commons.collections4.IterableGet.mapIterator.

Obtains an OrderedMapIterator over the map.
public K

Returns:

the next key, null if no match or at end
nextKey
(K
the key to search for next from
key
)

Gets the next key after the one specified.

public K

Returns:

the previous key, null if no match or at start
previousKey
(K
the key to search for previous from
key
)

Gets the previous key before the one specified.

Method Detail

firstKeyback to summary
public K firstKey()

Gets the first key currently in this map.

Returns:K

the first key currently in this map

Exceptions
NoSuchElementException:
if this map is empty
lastKeyback to summary
public K lastKey()

Gets the last key currently in this map.

Returns:K

the last key currently in this map

Exceptions
NoSuchElementException:
if this map is empty
mapIteratorback to summary
public OrderedMapIterator<K, V> mapIterator()

Redeclares org.apache.commons.collections4.IterableGet.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(K key)

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

previousKeyback to summary
public K previousKey(K key)

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