Class EmptyIntIterator

  • All Implemented Interfaces:
    IntIterator

    public final class EmptyIntIterator
    extends java.lang.Object
    implements IntIterator
    A singleton instance of an empty iterator; this is better than Collections.EMPTY_SET.iterator(), which allocates an iterator object;
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface IntIterator
        Returns:
        true iff this iterator has a next element
      • next

        public int next()
                 throws java.util.NoSuchElementException
        Specified by:
        next in interface IntIterator
        Returns:
        next integer in the iteration
        Throws:
        java.util.NoSuchElementException