Package ghidra.util
Class ReversedListIterator<E>
- java.lang.Object
-
- ghidra.util.ReversedListIterator<E>
-
- Type Parameters:
E
- the type of each element
- All Implemented Interfaces:
java.util.Iterator<E>
,java.util.ListIterator<E>
public class ReversedListIterator<E> extends java.lang.Object implements java.util.ListIterator<E>
Wraps aListIterator
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 usenew ReversedListIterator<>(list.listIterator(list.size()))
.
-
-
Constructor Summary
Constructors Constructor Description ReversedListIterator(java.util.ListIterator<E> it)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(E e)
boolean
hasNext()
boolean
hasPrevious()
E
next()
int
nextIndex()
E
previous()
int
previousIndex()
void
remove()
void
set(E e)
-
-
-
Constructor Detail
-
ReversedListIterator
public ReversedListIterator(java.util.ListIterator<E> it)
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
next
public E next()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interfacejava.util.ListIterator<E>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndex
in interfacejava.util.ListIterator<E>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndex
in interfacejava.util.ListIterator<E>
-
remove
public void remove()
-
-