Spliterator through Seqs provided by method seq().
This method may be called multiple times, and the returned Seqs may be consumed interchangeably.
Instances of this class ARE thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| private class | SeqBuffer.
Special |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private volatile boolean | buffering
|
| private final Spliterator |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static <T> SeqBuffer | |
| pack-priv static <T> SeqBuffer | |
| pack-priv Seq |
| buffer | back to summary |
|---|---|
| private final List<T> buffer | |
| buffering | back to summary |
|---|---|
| private volatile boolean buffering
| |
| source | back to summary |
|---|---|
| private final Spliterator<T> source | |
| SeqBuffer | back to summary |
|---|---|
| private SeqBuffer(Spliterator<T> source) | |
| of | back to summary |
|---|---|
pack-priv static <T> SeqBuffer
| |
| of | back to summary |
|---|---|
| pack-priv static <T> SeqBuffer | |
| seq | back to summary |
|---|---|
| pack-priv Seq Returns a | |
Spliterator whose tryAdvance method can buffer
(i.e. can advance the source spliterator).
Instances of this class are NOT thread-safe but they interact in a thread-safe way with SeqBuffer.
| Modifier and Type | Field and Description |
|---|---|
| private int | nextIndex
Index of the element that will be returned upon next call to |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private T | |
| private boolean | |
| private boolean | |
| public int | characteristics()
Implements java. Returns a set of characteristics of this Spliterator and its elements. |
| public long | estimateSize()
Implements java. Returns an estimate of the number of elements that would be
encountered by a |
| private long | |
| public Comparator | getComparator()
Overrides default java. If this Spliterator's source is |
| private int | |
| pack-priv SeqBuffer | |
| public boolean | tryAdvance(Consumer<? super T> action)
Implements java. If a remaining element exists: performs the given action on it,
returning |
| private boolean | tryAdvanceSource()
Buffers (i.e. advances the |
| private boolean | |
| private boolean | tryAdvanceThisWithBuffering(Consumer<? super T> action)
Tries to advance this |
| public Spliterator | trySplit()
Implements java. If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator. |
| nextIndex | back to summary |
|---|---|
| private int nextIndex Index of the element that will be returned upon next call to | |
| BufferSpliterator | back to summary |
|---|---|
| private BufferSpliterator() | |
| advanceThis | back to summary |
|---|---|
| private T advanceThis() | |
| canAdvanceThisAtOnce | back to summary |
|---|---|
| private boolean canAdvanceThisAtOnce() | |
| canAdvanceThisWithBuffering | back to summary |
|---|---|
| private boolean canAdvanceThisWithBuffering() | |
| characteristics | back to summary |
|---|---|
| public int characteristics() Implements java. Doc from java. Returns a set of characteristics of this Spliterator and its
elements. The result is represented as ORed values from If a Spliterator reports an inconsistent set of characteristics (either those returned from a single invocation or across multiple invocations), no guarantees can be made about any computation using this Spliterator.
| |
| estimateSize | back to summary |
|---|---|
| public long estimateSize() Implements java. Doc from java. Returns an estimate of the number of elements that would be
encountered by a If this Spliterator is
| |
| estimateSizeDuringBuffering | back to summary |
|---|---|
| private long estimateSizeDuringBuffering() Returns the estimate size of this Spliterator.
Synchronized to get an accurate sum of | |
| getComparator | back to summary |
|---|---|
| public Comparator Overrides default java. Doc from java. If this Spliterator's source is
| |
| numberOfElementsLeftInBuffer | back to summary |
|---|---|
| private int numberOfElementsLeftInBuffer() | |
| parentSeqBuffer | back to summary |
|---|---|
| pack-priv SeqBuffer | |
| tryAdvance | back to summary |
|---|---|
| public boolean tryAdvance(Consumer<? super T> action) Implements java. Doc from java. If a remaining element exists: performs the given action on it,
returning Subsequent behavior of a spliterator is unspecified if the action throws an exception.
| |
| tryAdvanceSource | back to summary |
|---|---|
| private boolean tryAdvanceSource() Buffers (i.e. advances the | |
| tryAdvanceThisAtOnce | back to summary |
|---|---|
| private boolean tryAdvanceThisAtOnce(Consumer<? super T> action) Called only when buffering has been completed. | |
| tryAdvanceThisWithBuffering | back to summary |
|---|---|
| private boolean tryAdvanceThisWithBuffering(Consumer<? super T> action) Tries to advance this | |
| trySplit | back to summary |
|---|---|
| public Spliterator Implements java. Doc from java. 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 Unless this Spliterator covers an infinite number of elements,
repeated calls to
This method may return
| |