Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
Spliterator.OfDouble is a specialized interface for processing streams of primitive double values.
It provides methods for iterating, splitting, and performing actions on elements of a double stream.
It inherits characteristics and methods from Spliterator, Spliterator.OfPrimitive, allowing for parallel processing and efficient stream manipulation.
trySplit() enables partitioning the stream for potential parallel execution, while tryAdvance() and forEachRemaining() provide ways to process individual elements or the entire remaining stream.
Several constants inherited from Spliterator describe the stream's properties, such as whether it's ordered, sized, or supports concurrent modification.
Characteristic value signifying that the element source may be safely
concurrently modified (allowing additions, replacements, and/or removals)
by multiple threads without external synchronization.
Characteristic value signifying that the element source cannot be
structurally modified; that is, elements cannot be added, replaced, or
removed, so such changes cannot occur during traversal.
Characteristic value signifying that the value returned from
estimateSize() prior to traversal or splitting represents a
finite size that, in the absence of structural source modification,
represents an exact count of the number of elements that would be
encountered by a complete traversal.
If this spliterator can be partitioned, returns a Spliterator
covering elements, that will, upon return from this method, not
be covered by this Spliterator.
Performs the given action for each remaining element, sequentially in
the current thread, until all elements have been processed or the
action throws an exception.
If this spliterator can be partitioned, returns a Spliterator
covering elements, that will, upon return from this method, not
be covered by this Spliterator.
Returns an estimate of the number of elements that would be
encountered by a forEachRemaining(Consumer super T>) traversal, or returns Long.MAX_VALUE if infinite, unknown, or too expensive to compute.
Performs the given action for each remaining element, sequentially in
the current thread, until all elements have been processed or the action
throws an exception.
If this spliterator can be partitioned, returns a Spliterator
covering elements, that will, upon return from this method, not
be covered by this Spliterator.
Public Methods
public
void
forEachRemaining(Consumer<? super Double> action)
If this spliterator can be partitioned, returns a Spliterator
covering elements, that will, upon return from this method, not
be covered by this Spliterator.
If this Spliterator is ORDERED, the returned Spliterator
must cover a strict prefix of the elements.
Unless this Spliterator covers an infinite number of elements,
repeated calls to trySplit() must eventually return null.
Upon non-null return:
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.
This method may return null for any reason,
including emptiness, inability to split after traversal has
commenced, data structure constraints, and efficiency
considerations.
Returns
a Spliterator covering some portion of the
elements, or null if this spliterator cannot be split
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],["`Spliterator.OfDouble` is a specialized interface for `double` values, enabling traversal and partitioning. Key actions include `forEachRemaining`, which processes remaining elements with a given action, and `tryAdvance`, which performs an action on the next element. `trySplit` attempts to partition the Spliterator, returning a new Spliterator that covers a portion of the elements. It also provides constant characteristics, like CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, and SUBSIZED.\n"]]