Most visited

Recently visited

Added in API level 24

Spliterator.OfInt

public static interface Spliterator.OfInt
implements OfPrimitive<IntegerIntConsumerSpliterator.OfInt>

java.util.Spliterator.OfInt
Known Indirect Subclasses


Spliterator专门用于 int值。

Summary

Inherited constants

From interface java.util.Spliterator

Public methods

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

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

abstract boolean tryAdvance(IntConsumer action)
abstract Spliterator.OfInt 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 (Consumer<? super Integer> action)

实现要求:
Parameters
action Consumer

forEachRemaining

Added in API level 24
void forEachRemaining (IntConsumer action)

Parameters
action IntConsumer

tryAdvance

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

实现要求:
Parameters
action Consumer
Returns
boolean

tryAdvance

Added in API level 24
boolean tryAdvance (IntConsumer action)

Parameters
action IntConsumer
Returns
boolean

trySplit

Added in API level 24
Spliterator.OfInt 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.OfInt a Spliterator covering some portion of the elements, or null if this spliterator cannot be split

Hooray!