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

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

protected class BasicEList.EListIterator
extends BasicEList.EIterator
implements ListIterator

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(Object object)
          Adds the object at the next index and advances the iterator past it.
 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.
 Object 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(Object 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, 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 ListIterator

previous

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

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

Specified by:
nextIndex in interface ListIterator
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 ListIterator
Returns:
the index of the object that would be returned by calling previous.

set

public void set(Object 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 ListIterator
Parameters:
object - the object to set.
Throws:
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(Object object)
Adds the object at the next index and advances the iterator past it. This implementation delegates to add(int, Object).

Specified by:
add in interface ListIterator
Parameters:
object - the object to add.

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