org.eclipse.emf.common.util
Class BasicEList.EIterator

java.lang.Object
  extended byorg.eclipse.emf.common.util.BasicEList.EIterator
All Implemented Interfaces:
Iterator
Direct Known Subclasses:
BasicEList.EListIterator, BasicEList.NonResolvingEIterator
Enclosing class:
BasicEList

protected class BasicEList.EIterator
extends Object
implements Iterator

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 BasicEList.EIterator()
           
 
Method Summary
protected  void checkModCount()
          Checks that the modification count is as expected.
 boolean hasNext()
          Returns whether there are more objects.
 Object 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

BasicEList.EIterator

protected BasicEList.EIterator()
Method Detail

hasNext

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

Specified by:
hasNext in interface Iterator
Returns:
whether there are more objects.

next

public Object next()
Returns the next object and advances the iterator. This implementation delegates to get.

Specified by:
next in interface Iterator
Returns:
the next object.
Throws:
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 Iterator
Throws:
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:
ConcurrentModificationException - if the modification count is not as expected.

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