Package org.eclipse.emf.common.util
Class AbstractEList.EIterator<E1>
java.lang.Object
org.eclipse.emf.common.util.AbstractEList.EIterator<E1>
- All Implemented Interfaces:
Iterator<E1>
- Direct Known Subclasses:
AbstractEList.EListIterator,AbstractEList.NonResolvingEIterator,ArrayDelegatingEList.EIterator,BasicEList.EIterator,DelegatingEList.EIterator
- Enclosing class:
AbstractEList<E>
An extensible iterator implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe current position of the iterator.protected intThe modification count of the containing list.protected intThe previous position of the iterator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidChecks that the modification count is as expected.protected EdoNext()Returns the next object and advances the iterator.booleanhasNext()Returns whether there are more objects.next()Returns the next object and advances the iterator.voidremove()Removes the last object returned bynext()from the list, it's an optional operation.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
-
Field Details
-
cursor
protected int cursorThe current position of the iterator. -
lastCursor
protected int lastCursorThe previous position of the iterator. -
expectedModCount
protected int expectedModCountThe modification count of the containing list.
-
-
Constructor Details
-
EIterator
protected EIterator()
-
-
Method Details
-
hasNext
public boolean hasNext()Returns whether there are more objects. -
next
Returns the next object and advances the iterator. This implementation delegates todoNext.- Specified by:
nextin interfaceIterator<E1>- Returns:
- the next object.
- Throws:
NoSuchElementException- if the iterator is done.
-
doNext
Returns the next object and advances the iterator. This implementation delegates toget.- Returns:
- the next object.
- Throws:
NoSuchElementException- if the iterator is done.
-
remove
public void remove()Removes the last object returned bynext()from the list, it's an optional operation. This implementation can also function in a list iterator to act upon on the object returned by callingprevious.- Specified by:
removein interfaceIterator<E1>- Throws:
IllegalStateException- ifnexthas not yet been called, orremovehas already been called after the last call tonext.
-
checkModCount
protected void checkModCount()Checks that the modification count is as expected.- Throws:
ConcurrentModificationException- if the modification count is not as expected.
-