org.eclipse.emf.common.util
Class DelegatingEList.EIterator<E1>

java.lang.Object
  extended by org.eclipse.emf.common.util.DelegatingEList.EIterator<E1>
All Implemented Interfaces:
java.util.Iterator<E1>
Direct Known Subclasses:
DelegatingEList.EListIterator, DelegatingEList.NonResolvingEIterator
Enclosing class:
DelegatingEList<E>

protected class DelegatingEList.EIterator<E1>
extends java.lang.Object
implements java.util.Iterator<E1>

An extensible iterator implementation.


Field Summary
protected  int cursor
          The current position of the iterator.
protected  int expectedModCount
          The modification count of the containing list.
protected  int lastCursor
          The previous position of the iterator.
 
Constructor Summary
protected DelegatingEList.EIterator()
           
 
Method Summary
protected  void checkModCount()
          Checks that the modification count is as expected.
protected  E doNext()
          Returns the next object and advances the iterator.
 boolean hasNext()
          Returns whether there are more objects.
 E1 next()
          Returns the next object and advances the iterator.
 void remove()
          Removes the last object returned by next() 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, wait
 

Field Detail

cursor

protected int cursor
The current position of the iterator.


lastCursor

protected int lastCursor
The previous position of the iterator.


expectedModCount

protected int expectedModCount
The modification count of the containing list.

Constructor Detail

DelegatingEList.EIterator

protected DelegatingEList.EIterator()
Method Detail

hasNext

public boolean hasNext()
Returns whether there are more objects.

Specified by:
hasNext in interface java.util.Iterator<E1>
Returns:
whether there are more objects.

next

public E1 next()
Returns the next object and advances the iterator. This implementation delegates to doNext.

Specified by:
next in interface java.util.Iterator<E1>
Returns:
the next object.
Throws:
java.util.NoSuchElementException - if the iterator is done.

doNext

protected E doNext()
Returns the next object and advances the iterator. This implementation delegates to get.

Returns:
the next object.
Throws:
java.util.NoSuchElementException - if the iterator is done.

remove

public void remove()
Removes the last object returned by next() 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 calling previous.

Specified by:
remove in interface java.util.Iterator<E1>
Throws:
java.lang.IllegalStateException - if next has not yet been called, or remove has already been called after the last call to next.

checkModCount

protected void checkModCount()
Checks that the modification count is as expected.

Throws:
java.util.ConcurrentModificationException - if the modification count is not as expected.

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.