Package dev.aherscu.qa.testing.extra
Class RangeSpliterator<C extends Spliterator<T>,T>
- java.lang.Object
-
- dev.aherscu.qa.testing.extra.RangeSpliterator<C,T>
-
- Type Parameters:
C
- the concrete spliteratorT
- the type over which the concrete spliterator runs
- All Implemented Interfaces:
Spliterator<T>
public abstract class RangeSpliterator<C extends Spliterator<T>,T> extends Object implements Spliterator<T>
Abstract spliterator over a numeric range of non-nulls.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T extends Object,T_CONS extends Object,T_SPLITR extends Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
-
-
Field Summary
-
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
-
Constructor Summary
Constructors Constructor Description RangeSpliterator(org.apache.commons.lang3.Range<Long> range)
Spliterator running over specified range, splitting to atomic units.RangeSpliterator(org.apache.commons.lang3.Range<Long> range, long atom)
Spliterator running over specified range, splitting until specified unit size.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
characteristics()
long
estimateSize()
protected abstract T
item(long index)
Override to supply requested item per specified index.protected abstract C
subSpliterator(org.apache.commons.lang3.Range<Long> range)
Override to create a new sub-spliterator per specified range.boolean
tryAdvance(Consumer<? super T> action)
C
trySplit()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Spliterator
forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics
-
-
-
-
Constructor Detail
-
RangeSpliterator
public RangeSpliterator(org.apache.commons.lang3.Range<Long> range)
Spliterator running over specified range, splitting to atomic units.- Parameters:
range
- range for this spliterator
-
RangeSpliterator
public RangeSpliterator(org.apache.commons.lang3.Range<Long> range, long atom)
Spliterator running over specified range, splitting until specified unit size.- Parameters:
range
- range for this spliteratoratom
- never split beyond
-
-
Method Detail
-
tryAdvance
public final boolean tryAdvance(Consumer<? super T> action)
- Specified by:
tryAdvance
in interfaceSpliterator<C extends Spliterator<T>>
-
trySplit
public final C trySplit()
- Specified by:
trySplit
in interfaceSpliterator<C extends Spliterator<T>>
-
estimateSize
public final long estimateSize()
- Specified by:
estimateSize
in interfaceSpliterator<C extends Spliterator<T>>
-
characteristics
public final int characteristics()
- Specified by:
characteristics
in interfaceSpliterator<C extends Spliterator<T>>
-
item
protected abstract T item(long index)
Override to supply requested item per specified index.- Parameters:
index
- the index of new requested item- Returns:
- the item
-
-