public static final class Spliterators.OfLong extends Object
Spliterator.OfLong
Modifier and Type | Method and Description |
---|---|
static void |
forEachRemaining(Spliterator.OfLong this_,
Consumer<? super Long> action)
Performs the given action for each remaining element, sequentially in
the current thread, until all elements have been processed or the action
throws an exception.
|
static void |
forEachRemaining(Spliterator.OfLong this_,
LongConsumer action)
Performs the given action for each remaining element of the passed Spliterator,
sequentially in the current thread, until all elements have been processed or
the action throws an exception.
|
static boolean |
tryAdvance(Spliterator.OfLong this_,
Consumer<? super Long> action)
If a remaining element exists, performs the given action on it,
returning
true ; else returns false . |
public static void forEachRemaining(Spliterator.OfLong this_, LongConsumer action)
this_
Spliterator is Spliterator.ORDERED
,
actions are performed in encounter order. Exceptions thrown by the
action are relayed to the caller.
Implementation Requirements:
The default implementation repeatedly invokes tryAdvance(java8.util.Spliterator.OfLong, java8.util.function.Consumer<? super java.lang.Long>)
until it returns false
. It should be overridden whenever
possible.
this_
- the Spliterator whose remaing elements should be processedaction
- The action to executeNullPointerException
- if the specified this_
Spliterator is nullNullPointerException
- if the specified action is nullpublic static boolean tryAdvance(Spliterator.OfLong this_, Consumer<? super Long> action)
true
; else returns false
. If the this_
Spliterator is Spliterator.ORDERED
the action is performed on the
next element in encounter order. Exceptions thrown by the
action are relayed to the caller.
Implementation Requirements:
If the action is an instance of LongConsumer
then it is cast
to LongConsumer
and passed to
Spliterator.OfLong.tryAdvance(java8.util.function.LongConsumer)
; otherwise
the action is adapted to an instance of LongConsumer
, by
boxing the argument of LongConsumer
, and then passed to
Spliterator.OfLong.tryAdvance(java8.util.function.LongConsumer)
.
this_
- the Spliterator to useaction
- The action to executefalse
if no remaining elements existed
upon entry to this method, else true
.NullPointerException
- if the specified this_
Spliterator is nullNullPointerException
- if the specified action is nullpublic static void forEachRemaining(Spliterator.OfLong this_, Consumer<? super Long> action)
this_
Spliterator is Spliterator.ORDERED
, actions
are performed in encounter order. Exceptions thrown by the action
are relayed to the caller.
Implementation Requirements:
If the action is an instance of LongConsumer
then it is cast
to LongConsumer
and passed to
Spliterator.OfLong.forEachRemaining(java8.util.function.LongConsumer)
; otherwise
the action is adapted to an instance of LongConsumer
, by
boxing the argument of LongConsumer
, and then passed to
Spliterator.OfLong.forEachRemaining(java8.util.function.LongConsumer)
.
this_
- the Spliterator to useaction
- The action to executeNullPointerException
- if the specified this_
Spliterator is nullNullPointerException
- if the specified action is nullCopyright © 2017. All rights reserved.