|Modifier and Type||Method and Description|
Performs the given action for all untraversed elements.
If a remaining element exists, performs the given action on it, returning
If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.
Spliterator.ORDERED, the returned Spliterator must cover a strict prefix of the elements. Unless this Spliterator is
Spliterator.INFINITE, repeated calls to
trySplit()must eventually return
null. Upon non-null return, the value reported for
estimateSize()for this and/or the returned Spliterator must decrease unless already zero.
This method may return
null for any reason,
including emptiness, inability to split after traversal has
commenced, data structure constraints, and efficiency
trySplit method efficiently (without
traversal) divides its elements exactly in half, allowing
balanced parallel computation. Most departures from this ideal
remain highly effective; for example, only approximately
splitting an approximately balanced tree, or for a tree in
which leaf nodes may contain either one or two elements,
failing to further split these nodes. However, large
deviations in balance and/or overly inefficient
trySplit mechanics typically result in poor parallel
The default implementation of this method always returns
null. It should be overridden whenever possible.
boolean tryAdvance(LongConsumer consumer)
default void forEach(LongConsumer consumer)
true; else returns
false. If this Spliterator is
Spliterator.ORDEREDthe action is performed on the next element in encounter order. Exceptions occurring as a result of performing this action are relayed to the caller.
Spliterator.ORDERED, actions are performed in encounter order. Exceptions occurring as a result of performing this action are relayed to the caller.
The default implementation repeatedly invokes
Spliterator.tryAdvance(java.util.function.Consumer<? super T>) until it returns
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.