[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/kotlin/java/util/PrimitiveIterator.OfInt [Back]  [Original]

PrimitiveIterator.OfInt  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.
Added in API level 24

OfInt

interface OfInt : PrimitiveIterator<Int!, IntConsumer!>
java.util.PrimitiveIterator.OfInt

An Iterator specialized for int values.

Summary

Public methods
open Unit
forEachRemaining(action: Consumer<in Int!>)

Performs the given action for each remaining element until all elements have been processed or the action throws an exception.

open Unit

Performs the given action for each remaining element until all elements have been processed or the action throws an exception.

open Int!

Returns the next element in the iteration.

abstract Int

Returns the next int element in the iteration.

Public methods

forEachRemaining

Added in API level 24
open fun forEachRemaining(action: Consumer<in Int!>): Unit

Performs the given action for each remaining element until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

The behavior of an iterator is unspecified if the action modifies the collection in any way (even by calling the remove method or other mutator methods of Iterator subtypes), unless an overriding class has specified a concurrent modification policy.

Subsequent behavior of an iterator is unspecified if the action throws an exception.

Parameters
action Consumer<in Int!>: The action to be performed for each element
Exceptions
java.lang.NullPointerException if the specified action is null

forEachRemaining

Added in API level 24
open fun forEachRemaining(action: IntConsumer!): Unit

Performs the given action for each remaining element until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

The behavior of an iterator is unspecified if the action modifies the source of elements in any way (even by calling the remove method or other mutator methods of Iterator subtypes), unless an overriding class has specified a concurrent modification policy.

Subsequent behavior of an iterator is unspecified if the action throws an exception.

Parameters
action IntConsumer!: The action to be performed for each element
Exceptions
java.lang.NullPointerException if the specified action is null

next

Added in API level 24
open fun next(): Int!

Returns the next element in the iteration.

Return
Int! the next element in the iteration
Exceptions
java.util.NoSuchElementException if the iteration has no more elements

nextInt

Added in API level 24
abstract fun nextInt(): Int

Returns the next int element in the iteration.

Return
Int the next int element in the iteration
Exceptions
java.util.NoSuchElementException if the iteration has no more elements

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page