E - public class ReverseListIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
| Modifier and Type | Field and Description |
|---|---|
protected int |
current
The current index of the list
|
protected java.util.List<E> |
list
The list to get elements from
|
| Constructor and Description |
|---|
ReverseListIterator(java.util.List<E> list)
Construct a ReverseListIterator for the given list.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Check if there are more elements.
|
E |
next()
Get the next element.
|
void |
remove()
Remove the current element.
|
protected final java.util.List<E> list
protected int current
public ReverseListIterator(java.util.List<E> list)
list - List to iterate over.public boolean hasNext()
hasNext in interface java.util.Iterator<E>public E next()
next in interface java.util.Iterator<E>java.util.NoSuchElementExceptionpublic void remove()
remove in interface java.util.Iterator<E>