Class UniformRandomProviderSupport.AbstractProviderSpliterator<T>
java.lang.Object
org.apache.commons.rng.UniformRandomProviderSupport.AbstractProviderSpliterator<T>
- Type Parameters:
T- the type of elements returned by thisSpliterator.
- All Implemented Interfaces:
Spliterator<T>
- Direct Known Subclasses:
UniformRandomProviderSupport.ProviderDoublesSpliterator, UniformRandomProviderSupport.ProviderIntsSpliterator, UniformRandomProviderSupport.ProviderLongsSpliterator, UniformRandomProviderSupport.ProviderSplitsSpliterator
- Enclosing class:
UniformRandomProviderSupport
private abstract static class UniformRandomProviderSupport.AbstractProviderSpliterator<T>
extends Object
implements Spliterator<T>
Base class for spliterators for streams of values. Contains the range current position and
end position. Splitting is expected to divide the range in half and create instances
that span the two ranges.
- Since:
- 1.5
-
Nested Class Summary
Nested classes/interfaces inherited from interface Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longThe upper limit of the range.protected longThe current position in the range.Fields inherited from interface Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
ConstructorsConstructorDescriptionAbstractProviderSpliterator(long position, long end) Constructs a new instance. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Spliterator
forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics, tryAdvance, trySplit
-
Field Details
-
position
protected long positionThe current position in the range. -
end
protected final long endThe upper limit of the range.
-
-
Constructor Details
-
AbstractProviderSpliterator
AbstractProviderSpliterator(long position, long end) Constructs a new instance.- Parameters:
position- Start position of the stream (inclusive).end- Upper limit of the stream (exclusive).
-
-
Method Details
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<T>
-
characteristics
public int characteristics()- Specified by:
characteristicsin interfaceSpliterator<T>
-