Interface IntListIterator

All Superinterfaces:
IntIterator

public interface IntListIterator extends IntIterator
This class represents iterators over lists of int values.
Since:
1.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int v)
    Adds a specified element to the list at this iterator's current position.
    boolean
    Indicates whether more int values can be returned by this iterator by calling previous().
    int
    Returns the index of the element that would be returned by a call to next().
    int
    Returns the previous int value of this iterator.
    int
    Returns the index of the element that would be returned by a call to previous().
    void
    set(int v)
    Sets the last element returned to a specified value.

    Methods inherited from interface zombie.util.IntIterator

    hasNext, next, remove
  • Method Details

    • add

      void add(int v)
      Adds a specified element to the list at this iterator's current position.
      Parameters:
      v - the element to add.
      Throws:
      UnsupportedOperationException - if addition is not supported by this iterator.
    • hasPrevious

      boolean hasPrevious()
      Indicates whether more int values can be returned by this iterator by calling previous().
      Returns:
      true if more int values can be returned by this iterator in backwards direction; returns false otherwise.
      See Also:
    • nextIndex

      int nextIndex()
      Returns the index of the element that would be returned by a call to next().
      Returns:
      the index of the element that would be returned by a call to next().
      See Also:
    • previous

      int previous()
      Returns the previous int value of this iterator.
      Returns:
      the previous int value of this iterator.
      Throws:
      NoSuchElementException - if no more elements are available from this iterator in backwards direction.
      See Also:
    • previousIndex

      int previousIndex()
      Returns the index of the element that would be returned by a call to previous().
      Returns:
      the index of the element that would be returned by a call to previous(); if no more elements are available in backwards direction, -1 is returned.
      See Also:
    • set

      void set(int v)
      Sets the last element returned to a specified value.
      Parameters:
      v - the new value of the element.
      Throws:
      UnsupportedOperationException - if replacement is not supported by this iterator.
      IllegalStateException - if no element has been returned by this iterator yet.