public abstract class DispatchSpliterator<T> extends Spliterators.AbstractSpliterator<T>
Spliterator
abstract base class that dispatches to
Spliterator
s supplied through an Spliterator
of
Spliterator
Supplier
s.Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS,T_SPLITR extends Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
Modifier | Constructor and Description |
---|---|
protected |
DispatchSpliterator(long estimate,
int characteristics)
See
Spliterators.AbstractSpliterator constructor. |
Modifier and Type | Method and Description |
---|---|
protected static long |
binomial(long n,
long k)
Method to count the number of combinations of
k -size that may
be chosen from a set of n -size (binomial coefficient). |
protected static long |
binomial(long n,
long k0,
long kN)
Method to count the number of combinations of
[k0,kN] size
that may be chosen from a set of n -size (binomial
coefficient). |
protected abstract Spliterator<Supplier<Spliterator<T>>> |
spliterators()
Method to provide the
Spliterator Supplier s. |
boolean |
tryAdvance(Consumer<? super T> consumer) |
Spliterator<T> |
trySplit() |
characteristics, estimateSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics
protected DispatchSpliterator(long estimate, int characteristics)
Spliterators.AbstractSpliterator
constructor.estimate
- The estimated size of this
Spliterator
if known, otherwise
Long.MAX_VALUE
.characteristics
- Properties of this Spliterator
's
source or elements. If Spliterator.SIZED
is
reported then this
Spliterator
will additionally report
Spliterator.SUBSIZED
.protected static long binomial(long n, long k)
k
-size that may
be chosen from a set of n
-size (binomial coefficient).n
- The size of the set.k
- The size of the subset to be chosen.k
-combinations.protected static long binomial(long n, long k0, long kN)
[k0,kN]
size
that may be chosen from a set of n
-size (binomial
coefficient).n
- The size of the set.k0
- The beginning of the interval (inclusive) of
size of the subsets to be chosen.kN
- The end of the interval (inclusive) of size
of the subsets to be chosen.protected abstract Spliterator<Supplier<Spliterator<T>>> spliterators()
Spliterator
Supplier
s. This
method is called sometime after the first call to
tryAdvance(Consumer)
.Iterator
of Spliterator
Supplier
s.public boolean tryAdvance(Consumer<? super T> consumer)
public Spliterator<T> trySplit()
trySplit
in interface Spliterator<T>
trySplit
in class Spliterators.AbstractSpliterator<T>
Copyright © 2015–2020 Allen D. Ball. All rights reserved.