Interface IntListIterator

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Check if there is a next element.
      boolean hasPrevious()
      Check if there is a previous element.
      void moveToEnd()
      Move the iterator to the end of the underlying index.
      void moveToStart()
      Move the iterator to the start of the underlying index.
      default int next()
      Return the next int in the list and increment the iterator.
      int nextNvc()
      version of next() which bypasses the validity check.
      default int previous()
      Return the previous int and decrement the iterator.
      int previousNvc()
      version of previous that bypasses the validity check.
    • Method Detail

      • 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 java.util.NoSuchElementException
        Return the next int in the list and increment the iterator.
        Returns:
        The next int.
        Throws:
        java.util.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 java.util.NoSuchElementException
        Return the previous int and decrement the iterator.
        Returns:
        the previous int (found by first moving the iterator one backwards).
        Throws:
        java.util.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.