public static interface Spliterator.OfPrimitive
implements Spliterator<T>
| java.util.Spliterator.OfPrimitive<T, T_CONS, T_SPLITR extends java.util.Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> |
| |
专为原始值设计的Spliterator。
Inherited constants |
|---|
java.util.Spliterator
|
公共方法(Public methods) |
|
|---|---|
default void |
forEachRemaining(T_CONS action) 对当前线程中的每个剩余元素执行给定操作,直到处理完所有元素或操作抛出异常。 |
abstract boolean |
tryAdvance(T_CONS action) 如果剩余的元素存在,则对其执行给定的操作,返回 |
abstract T_SPLITR |
trySplit() 如果这个分割器可以被分割,返回一个Spliterator覆盖元素,当从这个方法返回时,不会被这个分割器覆盖。 |
继承方法(Inherited methods) |
|
|---|---|
java.util.Spliterator
|
|
void forEachRemaining (T_CONS action)
对当前线程中的每个剩余元素执行给定操作,直到处理完所有元素或操作抛出异常。 如果此Spliterator是ORDERED ,则按照相遇顺序执行操作。 该操作引发的异常会中继给调用者。
tryAdvance(T_CONS) until it returns false. It should be overridden whenever possible.| 参数(Parameters) | |
|---|---|
action |
T_CONS: The action |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
if the specified action is null |
boolean tryAdvance (T_CONS action)
如果剩余的元素存在,则对其执行给定的操作,返回true ; 否则返回false 。 如果这个Spliterator是ORDERED ,那么这个动作是在遇到次序中的下一个元素上执行的。 该操作引发的异常会中继给调用者。
| 参数(Parameters) | |
|---|---|
action |
T_CONS: The action |
| 返回(Returns) | |
|---|---|
boolean |
false if no remaining elements existed upon entry to this method, else true. |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
if the specified action is null |
T_SPLITR trySplit ()
如果这个分割器可以被分割,返回一个Spliterator覆盖元素,当从这个方法返回时,不会被这个分割器覆盖。
如果此Spliterator为 ORDERED ,则返回的Spliterator必须覆盖元素的严格前缀。
除非此Spliterator覆盖无限数量的元素,否则重复调用trySplit()最终必须返回null 。 非空返回时:
estimateSize() before splitting, must, after splitting, be greater than or equal to estimateSize() for this and the returned Spliterator; andSUBSIZED, 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) | |
|---|---|
T_SPLITR |
a Spliterator covering some portion of the elements, or null if this spliterator cannot be split |