public interface DoubleSpliterator
extends java.util.Spliterator.OfDouble
Spliterator
; provides an additional methods to avoid (un)boxing, and
the possibility to skip elements.Spliterator
Modifier and Type | Method and Description |
---|---|
default void |
forEachRemaining(java.util.function.Consumer<? super java.lang.Double> action)
Deprecated.
Please use the corresponding type-specific method instead.
|
default void |
forEachRemaining(DoubleConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
default DoubleComparator |
getComparator() |
default long |
skip(long n)
Skips the given number of elements.
|
default boolean |
tryAdvance(java.util.function.Consumer<? super java.lang.Double> action)
Deprecated.
Please use the corresponding type-specific method instead.
|
default boolean |
tryAdvance(DoubleConsumer action)
Attempts to perform the action on the next element, or do nothing
but return
false if there are no remaining elements. |
DoubleSpliterator |
trySplit() |
@Deprecated default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Double> action)
tryAdvance
in interface java.util.Spliterator<java.lang.Double>
tryAdvance
in interface java.util.Spliterator.OfDouble
default boolean tryAdvance(DoubleConsumer action)
false
if there are no remaining elements.
WARNING: Overriding this method is almost always a mistake, as this
overload only exists to disambiguate. Instead, override the tryAdvance()
overload
that uses the JDK's primitive consumer type (e.g., IntConsumer
).
If Java supported final default methods, this would be one, but sadly it does not.
If you checked and are overriding the version with java.util.function.XConsumer
, and
still see this warning, then your IDE is incorrectly conflating this method with the proper
method to override, and you can safely ignore this message.
action
- the action to be performed on the next element.Spliterator.tryAdvance(java.util.function.Consumer)
@Deprecated default void forEachRemaining(java.util.function.Consumer<? super java.lang.Double> action)
forEachRemaining
in interface java.util.Spliterator<java.lang.Double>
forEachRemaining
in interface java.util.Spliterator.OfDouble
default void forEachRemaining(DoubleConsumer action)
WARNING: Overriding this method is almost always a mistake, as this
overload only exists to disambiguate. Instead, override the forEachRemaining()
overload
that uses the JDK's primitive consumer type (e.g. IntConsumer
).
If Java supported final default methods, this would be one, but sadly it does not.
If you checked and are overriding the version with java.util.function.XConsumer
, and
still see this warning, then your IDE is incorrectly conflating this method with the proper
method to override, and you can safely ignore this message.
action
- the action to be performed for each element.Spliterator.forEachRemaining(java.util.function.Consumer)
default long skip(long n)
The effect of this call is exactly the same as that of calling tryAdvance(java.util.function.Consumer<? super java.lang.Double>)
for
n
times (possibly stopping if tryAdvance(java.util.function.Consumer<? super java.lang.Double>)
returns false).
The action called will do nothing; elements will be discarded.
n
- the number of elements to skip.Spliterator.tryAdvance(java.util.function.Consumer<? super T>)
DoubleSpliterator trySplit()
trySplit
in interface java.util.Spliterator<java.lang.Double>
trySplit
in interface java.util.Spliterator.OfDouble
trySplit
in interface java.util.Spliterator.OfPrimitive<java.lang.Double,java.util.function.DoubleConsumer,java.util.Spliterator.OfDouble>
Spliterator.trySplit()
.default DoubleComparator getComparator()
getComparator
in interface java.util.Spliterator<java.lang.Double>
Spliterator.getComparator()
.