Class AbstractEList.EListIterator<E1>

java.lang.Object
AbstractEList<E>.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.
  • 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 for previous(). Returns whether there are more objects.
      Specified by:
      hasPrevious in interface ListIterator<E1>
    • previous

      public E1 previous()
      Returns the previous object and advances the iterator. This implementation delegates to doPrevious.
      Specified by:
      previous in interface ListIterator<E1>
      Returns:
      the previous object.
      Throws:
      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:
      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<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 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 ListIterator<E1>
      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.
    • 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:
      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 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.