org.eclipse.emf.common.util
Class BasicEList.EListIterator<E1>

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

protected class BasicEList.EListIterator<E1>
extends BasicEList.EIterator<E1>
implements java.util.ListIterator<E1>

An extensible list iterator implementation.


Field Summary
 
Fields inherited from class org.eclipse.emf.common.util.BasicEList.EIterator
cursor, expectedModCount, lastCursor
 
Constructor Summary
BasicEList.EListIterator()
          Creates an instance.
BasicEList.EListIterator(int index)
          Creates an instance advanced to the index.
 
Method Summary
 void add(E1 object)
          Adds the object at the next index and advances the iterator past it.
protected  void doAdd(E object)
          Adds the object at the next index and advances the iterator past it.
protected  E doPrevious()
          Returns the previous object and advances the iterator.
protected  void doSet(E object)
          Sets the object at the index of the last call to next or previous.
 boolean hasPrevious()
          Returns whether there are more objects for previous().
 int nextIndex()
          Returns the index of the object that would be returned by calling next.
 E1 previous()
          Returns the previous object and advances the iterator.
 int previousIndex()
          Returns the index of the object that would be returned by calling previous.
 void set(E1 object)
          Sets the object at the index of the last call to next or previous.
 
Methods inherited from class org.eclipse.emf.common.util.BasicEList.EIterator
checkModCount, doNext, hasNext, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.ListIterator
hasNext, next, remove
 

Constructor Detail

BasicEList.EListIterator

public BasicEList.EListIterator()
Creates an instance.


BasicEList.EListIterator

public BasicEList.EListIterator(int index)
Creates an instance advanced to the index.

Parameters:
index - the starting index.
Method Detail

hasPrevious

public boolean hasPrevious()
Returns whether there are more objects for previous(). Returns whether there are more objects.

Specified by:
hasPrevious in interface java.util.ListIterator<E1>

previous

public E1 previous()
Returns the previous object and advances the iterator. This implementation delegates to doPrevious.

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

doPrevious

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

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

nextIndex

public int nextIndex()
Returns the index of the object that would be returned by calling next.

Specified by:
nextIndex in interface java.util.ListIterator<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 calling previous.

Specified by:
previousIndex in interface java.util.ListIterator<E1>
Returns:
the index of the object that would be returned by calling previous.

set

public void set(E1 object)
Sets the object at the index of the last call to next or previous. This implementation delegates to set.

Specified by:
set in interface java.util.ListIterator<E1>
Parameters:
object - the object to set.
Throws:
java.lang.IllegalStateException - if next or previous have not yet been called, or remove or add have already been called after the last call to next or previous.

doSet

protected void doSet(E object)
Sets the object at the index of the last call to next or previous. This implementation delegates to set.

Parameters:
object - the object to set.
Throws:
java.lang.IllegalStateException - if next or previous have not yet been called, or remove or add have already been called after the last call to next or previous.

add

public void add(E1 object)
Adds the object at the next index and advances the iterator past it. This implementation delegates to doAdd(E).

Specified by:
add in interface java.util.ListIterator<E1>
Parameters:
object - the object to add.

doAdd

protected void doAdd(E object)
Adds the object at the next index and advances the iterator past it. This implementation delegates to add(int, E).

Parameters:
object - the object to add.

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