Package org.apache.commons.collections
Interface OrderedMap
- All Superinterfaces:
IterableMap,Map
- All Known Subinterfaces:
OrderedBidiMap,SortedBidiMap
- All Known Implementing Classes:
AbstractLinkedMap,AbstractOrderedBidiMapDecorator,AbstractOrderedMapDecorator,AbstractSortedBidiMapDecorator,DualTreeBidiMap,LinkedMap,ListOrderedMap,LRUMap,SingletonMap,TreeBidiMap,UnmodifiableOrderedBidiMap,UnmodifiableOrderedMap,UnmodifiableSortedBidiMap
Deprecated.
Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.
Defines a map that maintains order and allows both forward and backward
iteration through that order.
- Since:
- Commons Collections 3.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionfirstKey()Deprecated.Gets the first key currently in this map.lastKey()Deprecated.Gets the last key currently in this map.Deprecated.Gets the next key after the one specified.Deprecated.Obtains anOrderedMapIteratorover the map.previousKey(Object key) Deprecated.Gets the previous key before the one specified.Methods inherited from interface org.apache.commons.collections.IterableMap
mapIteratorMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Method Details
-
orderedMapIterator
OrderedMapIterator orderedMapIterator()Deprecated.Obtains anOrderedMapIteratorover the map.A ordered map iterator is an efficient way of iterating over maps in both directions.
BidiMap map = new TreeBidiMap(); MapIterator it = map.mapIterator(); while (it.hasNext()) { Object key = it.next(); Object value = it.getValue(); it.setValue("newValue"); Object previousKey = it.previous(); }- Returns:
- a map iterator
-
firstKey
Object firstKey()Deprecated.Gets the first key currently in this map.- Returns:
- the first key currently in this map
- Throws:
NoSuchElementException- if this map is empty
-
lastKey
Object lastKey()Deprecated.Gets the last key currently in this map.- Returns:
- the last key currently in this map
- Throws:
NoSuchElementException- if this map is empty
-
nextKey
Deprecated.Gets the next key after the one specified.- Parameters:
key- the key to search for next from- Returns:
- the next key, null if no match or at end
-
previousKey
Deprecated.Gets the previous key before the one specified.- Parameters:
key- the key to search for previous from- Returns:
- the previous key, null if no match or at start
-