Class IntIterators.UnmodifiableIterator

  • All Implemented Interfaces:
    IntIterator, java.util.Iterator<java.lang.Integer>, java.util.PrimitiveIterator<java.lang.Integer,​java.util.function.IntConsumer>, java.util.PrimitiveIterator.OfInt
    Enclosing class:
    IntIterators

    public static class IntIterators.UnmodifiableIterator
    extends java.lang.Object
    implements IntIterator
    An unmodifiable wrapper class for iterators.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.PrimitiveIterator

        java.util.PrimitiveIterator.OfDouble, java.util.PrimitiveIterator.OfInt, java.util.PrimitiveIterator.OfLong
    • Constructor Detail

      • UnmodifiableIterator

        public UnmodifiableIterator​(IntIterator i)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<java.lang.Integer>
      • nextInt

        public int nextInt()
        Description copied from interface: IntIterator
        Returns the next element as a primitive type.
        Specified by:
        nextInt in interface IntIterator
        Specified by:
        nextInt in interface java.util.PrimitiveIterator.OfInt
        Returns:
        the next element in the iteration.
        See Also:
        Iterator.next()
      • forEachRemaining

        public void forEachRemaining​(java.util.function.IntConsumer action)
        Specified by:
        forEachRemaining in interface java.util.PrimitiveIterator<java.lang.Integer,​java.util.function.IntConsumer>
        Specified by:
        forEachRemaining in interface java.util.PrimitiveIterator.OfInt
      • forEachRemaining

        @Deprecated
        public void forEachRemaining​(java.util.function.Consumer<? super java.lang.Integer> action)
        Deprecated.
        Description copied from interface: IntIterator
        Specified by:
        forEachRemaining in interface IntIterator
        Specified by:
        forEachRemaining in interface java.util.Iterator<java.lang.Integer>
        Specified by:
        forEachRemaining in interface java.util.PrimitiveIterator.OfInt