public abstract class DispatchSpliterator<T> extends Spliterators.AbstractSpliterator<T>
Spliterator abstract base class that dispatches to
Spliterators supplied through an Spliterator of
Spliterator Suppliers.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 Suppliers. |
boolean |
tryAdvance(Consumer<? super T> consumer) |
Spliterator<T> |
trySplit() |
characteristics, estimateSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristicsprotected 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 abstract Spliterator<Supplier<Spliterator<T>>> spliterators()
Spliterator Suppliers. This
method is called sometime after the first call to
tryAdvance(Consumer).Iterator of Spliterator
Suppliers.public Spliterator<T> trySplit()
trySplit in interface Spliterator<T>trySplit in class Spliterators.AbstractSpliterator<T>public boolean tryAdvance(Consumer<? super T> consumer)
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 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.Copyright © 2015–2021. All rights reserved.