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>`

public class ReversedListIterator<E> extends Object implements 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 Summary

  Constructors
  Constructor
  Description
  `ReversedListIterator(ListIterator<E> it)`

- ## Method Summary

  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)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.Iterator

  `forEachRemaining`

- ## Constructor Details

  - ### ReversedListIterator

    public ReversedListIterator(ListIterator<E> it)

- ## Method Details

  - ### hasNext

    public boolean hasNext()
    Specified by:
      `hasNext` in interface `Iterator<E>`
    Specified by:
      `hasNext` in interface `ListIterator<E>`

  - ### next

    public E next()
    Specified by:
      `next` in interface `Iterator<E>`
    Specified by:
      `next` in interface `ListIterator<E>`

  - ### hasPrevious

    public boolean hasPrevious()
    Specified by:
      `hasPrevious` in interface `ListIterator<E>`

  - ### previous

    public E previous()
    Specified by:
      `previous` in interface `ListIterator<E>`

  - ### nextIndex

    public int nextIndex()
    Specified by:
      `nextIndex` in interface `ListIterator<E>`

  - ### previousIndex

    public int previousIndex()
    Specified by:
      `previousIndex` in interface `ListIterator<E>`

  - ### remove

    public void remove()
    Specified by:
      `remove` in interface `Iterator<E>`
    Specified by:
      `remove` in interface `ListIterator<E>`

  - ### set

    public void set(E e)
    Specified by:
      `set` in interface `ListIterator<E>`

  - ### add

    public void add(E e)
    Specified by:
      `add` in interface `ListIterator<E>`