codecamp

鸿蒙OS PrimitiveIterator.OfInt

PrimitiveIterator.OfInt

public static interface PrimitiveIterator.OfInt
extends PrimitiveIterator<Integer,IntConsumer>

一个专门用于 int 值的迭代器。

嵌套类摘要

从接口 java.util.PrimitiveIterator 继承的嵌套类/接口
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong

方法总结

修饰符和类型 方法 描述
default void forEachRemaining(Consumer<? super Integer> action) 对每个剩余元素执行给定的操作,直到所有元素都已处理或该操作引发异常。
default void forEachRemaining(IntConsumer action) 对每个剩余元素执行给定的操作,直到所有元素都已处理或该操作引发异常。
default Integer next() 返回迭代中的下一个元素。
int nextInt() 返回迭代中的下一个 int 元素。
从接口 java.util.Iterator 继承的方法
hasNext, remove

方法详情

nextInt

int nextInt()

返回迭代中的下一个 int 元素。

返回:

迭代中的下一个 int 元素

Throws:

Throw名称 Throw描述
NoSuchElementException 如果迭代没有更多元素

forEachRemaining

default void forEachRemaining(IntConsumer action)

对每个剩余元素执行给定的操作,直到所有元素都已处理或该操作引发异常。 如果指定了迭代顺序,则按迭代顺序执行操作。 操作引发的异常将转发给调用者。

指定者:

接口 PrimitiveIteratorInteger,IntConsumer 中的 forEachRemaining

参数:

参数名称 参数描述
action 为每个元素执行的操作

Throws:

Throw名称 Throw描述
NullPointerException 如果指定的操作为空

next

default Integer next()

返回迭代中的下一个元素。

指定者:

接口 IteratorInteger 中的下一个

返回:

迭代中的下一个元素

forEachRemaining

default void forEachRemaining(Consumer<? super Integer> action)

对每个剩余元素执行给定的操作,直到所有元素都已处理或该操作引发异常。 如果指定了迭代顺序,则按迭代顺序执行操作。 操作引发的异常将转发给调用者。

指定者:

接口 IteratorInteger 中的 forEachRemaining

参数:

参数名称 参数描述
action 为每个元素执行的操作
鸿蒙OS PrimitiveIterator.OfDouble
鸿蒙OS PrimitiveIterator.OfLong
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

鸿蒙OS 开发

鸿蒙OS 术语

鸿蒙OS Java API参考

鸿蒙OS ohos.aafwk.ability

鸿蒙OS ohos.aafwk.abilityjet.activedata

鸿蒙OS ohos.aafwk.content

鸿蒙OS java.lang

鸿蒙OS java.Util

鸿蒙OS java.Util class

鸿蒙OS ohos.data.dataability

鸿蒙OS ohos.data.dataability class

鸿蒙OS ohos.agp.components

鸿蒙OS ohos.agp.components interface

鸿蒙OS ohos.agp.components class

鸿蒙OS ohos.global.configuration

鸿蒙OS java.io

鸿蒙OS ohos.data.resultset

鸿蒙OS ohos.data.resultset interface

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }