Package ghidra.util
Class ReversedListIterator<E>
java.lang.Object
ghidra.util.ReversedListIterator<E>
- Type Parameters:
E
- the type of each element
- All Implemented Interfaces:
Iterator<E>
,ListIterator<E>
Wraps a
ListIterator
so that the operations are reversed.
NOTE: you must obtain an iterator that is already at its end. E.g., if you wish to traverse a
list in reverse, you would use
new ReversedListIterator<>(list.listIterator(list.size()))
.-
Constructor Details
-
ReversedListIterator
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceListIterator<E>
-
previous
- Specified by:
previous
in interfaceListIterator<E>
-
nextIndex
public int nextIndex()- Specified by:
nextIndex
in interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndex
in interfaceListIterator<E>
-
remove
public void remove() -
set
- Specified by:
set
in interfaceListIterator<E>
-
add
- Specified by:
add
in interfaceListIterator<E>
-