Interface OrderedMapIterator<K,V>
- Type Parameters:
K
- the type of the keys in the mapV
- the type of the values in the map
- All Superinterfaces:
Iterator<K>
,MapIterator<K,
,V> OrderedIterator<K>
- All Known Implementing Classes:
AbstractLinkedMap.LinkMapIterator
,AbstractSortedMapDecorator.SortedMapIterator
,DualTreeBidiMap.BidiOrderedMapIterator
,EmptyOrderedMapIterator
,UnmodifiableOrderedMapIterator
Defines an iterator that operates over an ordered
Map
.
This iterator allows both forward and reverse iteration through the map.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks to see if there is a previous entry that can be iterated to.previous()
Gets the previous key from theMap
.Methods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
hasPrevious
boolean hasPrevious()Checks to see if there is a previous entry that can be iterated to.- Specified by:
hasPrevious
in interfaceOrderedIterator<K>
- Returns:
true
if the iterator has a previous element
-
previous
K previous()Gets the previous key from theMap
.- Specified by:
previous
in interfaceOrderedIterator<K>
- Returns:
- the previous key in the iteration
- Throws:
NoSuchElementException
- if the iteration is finished
-