Interface IntIterator

All Known Implementing Classes:
LexBFSIteratorInt, MaximumCardinalityIterator, TopologicalOrderIterator

public interface IntIterator
An iterator over a collection of primitive integers.
Author:
Cristian Frăsinaru
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the iteration has more elements.
    int
    Returns the next element in the iteration.
    default void
    Removes from the underlying collection the last element returned by this iterator (optional operation).
  • Method Details

    • hasNext

      boolean hasNext()
      Returns true if the iteration has more elements.
      Returns:
      true if the iteration has more elements, false otherwise.
    • next

      int next()
      Returns the next element in the iteration.
      Returns:
      the next element in the iteration.
      Throws:
      NoSuchElementException - if the iteration has no more elements.
    • remove

      default void remove()
      Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next().
      Throws:
      UnsupportedOperationException - if the remove operation is not supported by this iterator.