public final class UnmodifiableListIterator<E> extends Object implements ListIterator<E>, Unmodifiable
Attempts to modify it will result in an UnsupportedOperationException.
Modifier and Type | Method and Description |
---|---|
void |
add(E obj) |
boolean |
hasNext() |
boolean |
hasPrevious() |
E |
next() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
void |
remove() |
void |
set(E obj) |
static <E> ListIterator<E> |
umodifiableListIterator(ListIterator<? extends E> iterator)
Decorates the specified iterator such that it cannot be modified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public static <E> ListIterator<E> umodifiableListIterator(ListIterator<? extends E> iterator)
E
- the element typeiterator
- the iterator to decorateNullPointerException
- if the iterator is nullpublic boolean hasNext()
public E next()
public int nextIndex()
nextIndex
in interface ListIterator<E>
public boolean hasPrevious()
hasPrevious
in interface ListIterator<E>
public E previous()
previous
in interface ListIterator<E>
public int previousIndex()
previousIndex
in interface ListIterator<E>
public void remove()
public void set(E obj)
set
in interface ListIterator<E>
public void add(E obj)
add
in interface ListIterator<E>
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.