Interface IntListIterator

All Known Subinterfaces:
ComparableIntIterator
All Known Implementing Classes:
Common_hash_support.CommonKeyIterator

public interface IntListIterator
Int iterator in the Java style, but returning/using ints. Contrast with IntPointerIterator, which is in the UIMA style allowing forward and backwards movement.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check if there is a next element.
    boolean
    Check if there is a previous element.
    void
    Move the iterator to the end of the underlying index.
    void
    Move the iterator to the start of the underlying index.
    default int
    Return the next int in the list and increment the iterator.
    int
    version of next() which bypasses the validity check.
    default int
    Return the previous int and decrement the iterator.
    int
    version of previous that bypasses the validity check.
  • Method Details

    • hasNext

      boolean hasNext()
      Check if there is a next element. Does not move the iterator.
      Returns:
      true iff there is a next element.
    • next

      default int next() throws NoSuchElementException
      Return the next int in the list and increment the iterator.
      Returns:
      The next int.
      Throws:
      NoSuchElementException - If no next element exists, i.e., when the iterator points at the last position in the index.
    • nextNvc

      int nextNvc()
      version of next() which bypasses the validity check. Only use this if you've already done this check yourself.
      Returns:
      the next int in the list and increment the iterator.
    • hasPrevious

      boolean hasPrevious()
      Check if there is a previous element. Does not move the iterator.
      Returns:
      true iff there is a previous element.
    • previous

      default int previous() throws NoSuchElementException
      Return the previous int and decrement the iterator.
      Returns:
      the previous int (found by first moving the iterator one backwards).
      Throws:
      NoSuchElementException - If no previous element exists, i.e., when the iterator points at the first position in the index.
    • previousNvc

      int previousNvc()
      version of previous that bypasses the validity check. Only use this if you've already done this check yourself.
      Returns:
      the previous int (found by first moving the iterator one backwards).
    • moveToStart

      void moveToStart()
      Move the iterator to the start of the underlying index.
    • moveToEnd

      void moveToEnd()
      Move the iterator to the end of the underlying index.