Most visited

Recently visited

Added in API level 24

Spliterator.OfLong

public static interface Spliterator.OfLong
implements OfPrimitive<LongLongConsumerSpliterator.OfLong>

java.util.Spliterator.OfLong
Known Indirect Subclasses


Spliterator专门为 long值。

Summary

Inherited constants

From interface java.util.Spliterator

Public methods

default void forEachRemaining(LongConsumer action)
default void forEachRemaining(Consumer<? super Long> action)

abstract boolean tryAdvance(LongConsumer action)
default boolean tryAdvance(Consumer<? super Long> action)

abstract Spliterator.OfLong trySplit()

如果这个分割器可以被分割,返回一个Spliterator覆盖元素,当从这个方法返回时,不会被这个分割器覆盖。

Inherited methods

From interface java.util.Spliterator.OfPrimitive
From interface java.util.Spliterator

Public methods

forEachRemaining

Added in API level 24
void forEachRemaining (LongConsumer action)

Parameters
action LongConsumer

forEachRemaining

Added in API level 24
void forEachRemaining (Consumer<? super Long> action)

实现要求:
Parameters
action Consumer

tryAdvance

Added in API level 24
boolean tryAdvance (LongConsumer action)

Parameters
action LongConsumer
Returns
boolean

tryAdvance

Added in API level 24
boolean tryAdvance (Consumer<? super Long> action)

实现要求:
Parameters
action Consumer
Returns
boolean

trySplit

Added in API level 24
Spliterator.OfLong trySplit ()

如果这个分割器可以被分割,返回一个Spliterator覆盖元素,当从这个方法返回时,不会被这个分割器覆盖。

如果此Spliterator为 ORDERED ,则返回的Spliterator必须覆盖元素的严格前缀。

除非此Spliterator覆盖无限数量的元素,否则重复调用trySplit()必须最终返回null 非空返回时:

  • the value reported for estimateSize() before splitting, must, after splitting, be greater than or equal to estimateSize() for this and the returned Spliterator; and
  • if this Spliterator is SUBSIZED, then estimateSize() for this spliterator before splitting must be equal to the sum of estimateSize() for this and the returned Spliterator after splitting.

此方法可能因任何原因返回 null ,包括空行,遍历开始后无法拆分,数据结构约束和效率考虑。

Returns
Spliterator.OfLong a Spliterator covering some portion of the elements, or null if this spliterator cannot be split

Hooray!