L
- the type of the containing listE
- the type of elements returned by this list iterator@ParametersAreNonnullByDefault public class LazyListIterator<L extends List<E>,E> extends LazyIterator<L,E> implements ListIterator<E>
ListIterator
that delegates its operations (structural and verification) to the containing list.containingList, cursor, expectedModCount, lastCursor, modCount, size
Constructor and Description |
---|
LazyListIterator(L containingList,
IntSupplier modCount)
Constructs a new
LazyListIterator . |
LazyListIterator(L containingList,
IntSupplier modCount,
int index)
Constructs a new
LazyListIterator . |
Modifier and Type | Method and Description |
---|---|
void |
add(E e) |
protected void |
doAdd(int index,
E element)
Inserts the specified
element at the specified index in the containing list. |
protected void |
doSet(int index,
E element)
Replaces the element at the specified
index in the containing list with the specified element . |
boolean |
hasPrevious() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
void |
set(E e) |
checkModCount, checkNotReadOnly, doGet, doRemove, hasNext, next, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasNext, next, remove
forEachRemaining
public LazyListIterator(L containingList, IntSupplier modCount)
LazyListIterator
.containingList
- the containing listmodCount
- the function to retrieve the modification count of the containing listpublic LazyListIterator(L containingList, IntSupplier modCount, int index)
LazyListIterator
.containingList
- the containing listmodCount
- the function to retrieve the modification count of the containing listindex
- the starting indexpublic final boolean hasPrevious()
hasPrevious
in interface ListIterator<E>
public final E previous()
previous
in interface ListIterator<E>
public int nextIndex()
nextIndex
in interface ListIterator<E>
public int previousIndex()
previousIndex
in interface ListIterator<E>
public final void set(E e)
set
in interface ListIterator<E>
public final void add(E e)
add
in interface ListIterator<E>
protected void doSet(int index, E element)
index
in the containing list with the specified element
.index
- index of the element to replaceelement
- element to be stored at the specified positionprotected void doAdd(int index, E element)
element
at the specified index
in the containing list.index
- index at which the specified element is to be insertedelement
- element to be insertedCopyright © 2013–2019 Atlanmod. All rights reserved.