public static interface PrimitiveIterator.OfLong extends PrimitiveIterator<Long,LongConsumer>
long値に特化されたイテレータ。PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong| 修飾子と型 | メソッド | 説明 |
|---|---|---|
default void |
forEachRemaining(Consumer<? super Long> action) |
すべての要素の処理が完了するかアクションから例外がスローされるまで、残りの各要素に対して指定されたアクションを実行します。
|
default void |
forEachRemaining(LongConsumer action) |
すべての要素の処理が完了するかアクションから例外がスローされるまで、残りの各要素に対して指定されたアクションを実行します。
|
default Long |
next() |
反復処理で次の要素を返します。
|
long |
nextLong() |
反復で次の
long要素を返します。 |
long nextLong()
long要素を返します。long要素NoSuchElementException - 反復処理で要素がない場合default void forEachRemaining(LongConsumer action)
forEachRemaining、インタフェースPrimitiveIterator<Long,LongConsumer>デフォルト実装は次のように動作します。
while (hasNext())
action.accept(nextLong());
action - 各要素に対して実行されるアクションNullPointerException - 指定されたアクションがnullである場合default Long next()
next、インタフェースIterator<Long>nextLong()呼び出しの結果をボクシングし、ボクシング結果を返します。default void forEachRemaining(Consumer<? super Long> action)
forEachRemaining、インタフェースIterator<Long>LongConsumerのインスタンスの場合、LongConsumerにキャストされ、forEachRemaining(java.util.function.LongConsumer)に渡されます。それ以外の場合、アクションはLongConsumerの引数をボクシングすることによってLongConsumerのインスタンスに適応されてから、forEachRemaining(java.util.function.LongConsumer)に渡されます。action - 各要素に対して実行されるアクション バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。