Module org.jhotdraw8.collection
Class FailFastListIterator<E>
java.lang.Object
org.jhotdraw8.collection.iterator.FailFastListIterator<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
Iterator<E>,ListIterator<E>
An iterator that fails when a provided modification counter does not have an
expected value.
-
Constructor Summary
ConstructorsConstructorDescriptionFailFastListIterator(@NonNull ListIterator<E> i, @NonNull IntSupplier modCountSupplier) FailFastListIterator(@NonNull ListIterator<E> i, @NonNull IntSupplier modCountSupplier, @NonNull Runnable removeFunction) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
FailFastListIterator
-
FailFastListIterator
public FailFastListIterator(@NonNull ListIterator<E> i, @NonNull IntSupplier modCountSupplier, @NonNull Runnable removeFunction)
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceListIterator<E>
-
previous
- Specified by:
previousin interfaceListIterator<E>
-
nextIndex
public int nextIndex()- Specified by:
nextIndexin interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndexin interfaceListIterator<E>
-
ensureUnmodified
protected void ensureUnmodified() -
remove
public void remove() -
set
- Specified by:
setin interfaceListIterator<E>
-
add
- Specified by:
addin interfaceListIterator<E>
-