Class AbstractEList.EIterator<E1>

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

protected class AbstractEList.EIterator<E1> extends Object implements Iterator<E1>
An extensible iterator implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The current position of the iterator.
    protected int
    The modification count of the containing list.
    protected int
    The previous position of the iterator.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Checks that the modification count is as expected.
    protected E
    Returns the next object and advances the iterator.
    boolean
    Returns whether there are more objects.
    Returns the next object and advances the iterator.
    void
    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

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Field Details

    • 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 Details

    • EIterator

      protected EIterator()
  • Method Details

    • hasNext

      public boolean hasNext()
      Returns whether there are more objects.
      Specified by:
      hasNext in interface 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 Iterator<E1>
      Returns:
      the next object.
      Throws:
      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:
      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<E1>
      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.