Package org.eclipse.emf.common.util
Class AbstractEList.EListIterator<E1>
java.lang.Object
AbstractEList<E>.org.eclipse.emf.common.util.AbstractEList.EIterator<E1>
org.eclipse.emf.common.util.AbstractEList.EListIterator<E1>
- All Implemented Interfaces:
Iterator<E1>,ListIterator<E1>
- Direct Known Subclasses:
AbstractEList.NonResolvingEListIterator,ArrayDelegatingEList.EListIterator,BasicEList.EListIterator,DelegatingEList.EListIterator
- Enclosing class:
AbstractEList<E>
protected class AbstractEList.EListIterator<E1>
extends AbstractEList<E>.EIterator<E1>
implements ListIterator<E1>
An extensible list iterator implementation.
-
Field Summary
Fields inherited from class org.eclipse.emf.common.util.AbstractEList.EIterator
cursor, expectedModCount, lastCursor -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance.EListIterator(int index) Creates an instance advanced to the index. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the object at thenextindex and advances the iterator past it.protected voidAdds the object at thenextindex and advances the iterator past it.protected EReturns the previous object and advances the iterator.protected voidbooleanReturns whether there are more objects forprevious().intReturns the index of the object that would be returned by callingnext.previous()Returns the previous object and advances the iterator.intReturns the index of the object that would be returned by callingprevious.voidMethods inherited from class org.eclipse.emf.common.util.AbstractEList.EIterator
checkModCount, doNext, hasNext, next, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemainingMethods inherited from interface java.util.ListIterator
hasNext, next, remove
-
Constructor Details
-
EListIterator
public EListIterator()Creates an instance. -
EListIterator
public EListIterator(int index) Creates an instance advanced to the index.- Parameters:
index- the starting index.
-
-
Method Details
-
hasPrevious
public boolean hasPrevious()Returns whether there are more objects forprevious(). Returns whether there are more objects.- Specified by:
hasPreviousin interfaceListIterator<E1>
-
previous
Returns the previous object and advances the iterator. This implementation delegates todoPrevious.- Specified by:
previousin interfaceListIterator<E1>- Returns:
- the previous object.
- Throws:
NoSuchElementException- if the iterator is done.
-
doPrevious
Returns the previous object and advances the iterator. This implementation delegates toget.- Returns:
- the previous object.
- Throws:
NoSuchElementException- if the iterator is done.
-
nextIndex
public int nextIndex()Returns the index of the object that would be returned by callingnext.- Specified by:
nextIndexin interfaceListIterator<E1>- Returns:
- the index of the object that would be returned by calling
next.
-
previousIndex
public int previousIndex()Returns the index of the object that would be returned by callingprevious.- Specified by:
previousIndexin interfaceListIterator<E1>- Returns:
- the index of the object that would be returned by calling
previous.
-
set
Sets the object at the index of the last call tonextorprevious. This implementation delegates toset.- Specified by:
setin interfaceListIterator<E1>- Parameters:
object- the object to set.- Throws:
IllegalStateException- ifnextorprevioushave not yet been called, orremoveoraddhave already been called after the last call tonextorprevious.
-
doSet
Sets the object at the index of the last call tonextorprevious. This implementation delegates toset.- Parameters:
object- the object to set.- Throws:
IllegalStateException- ifnextorprevioushave not yet been called, orremoveoraddhave already been called after the last call tonextorprevious.
-
add
Adds the object at thenextindex and advances the iterator past it. This implementation delegates todoAdd(E).- Specified by:
addin interfaceListIterator<E1>- Parameters:
object- the object to add.
-
doAdd
Adds the object at thenextindex and advances the iterator past it. This implementation delegates toadd(int, E).- Parameters:
object- the object to add.
-