Package org.apache.sis.internal.util
Class ListOfUnknownSize.Iterator
java.lang.Object
org.apache.sis.internal.util.ListOfUnknownSize.Iterator
- All Implemented Interfaces:
Iterator<E>
,ListIterator<E>
- Enclosing class:
- ListOfUnknownSize<E>
The iterator returned by
AbstractList.listIterator()
. Provided as a named class instead
than anonymous class for more readable stack traces. This is especially useful since
elements may be loaded or computed when first needed, and those operations may fail.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
hasNext()
Whethernext()
can succeed.boolean
Whetherprevious()
can succeed.next()
Move forward by one element.int
Index of element to be returned bynext()
.previous()
Move backward by one element.int
Index of element to be returned byprevious()
.void
remove()
void
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
-
Field Details
-
cursor
private int cursorIndex of the next element to be returned.
-
-
Constructor Details
-
Iterator
Iterator(int index) Creates a new iterator starting at the given index.
-
-
Method Details
-
nextIndex
public int nextIndex()Index of element to be returned bynext()
.- Specified by:
nextIndex
in interfaceListIterator<E>
-
hasNext
public boolean hasNext()Whethernext()
can succeed. -
next
Move forward by one element. -
previousIndex
public int previousIndex()Index of element to be returned byprevious()
.- Specified by:
previousIndex
in interfaceListIterator<E>
-
hasPrevious
public boolean hasPrevious()Whetherprevious()
can succeed.- Specified by:
hasPrevious
in interfaceListIterator<E>
-
previous
Move backward by one element.- Specified by:
previous
in interfaceListIterator<E>
-
set
- Specified by:
set
in interfaceListIterator<E>
-
add
- Specified by:
add
in interfaceListIterator<E>
-
remove
public void remove()
-