Class RangeSpliterator<C extends Spliterator<T>,​T>

  • Type Parameters:
    C - the concrete spliterator
    T - 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.
    • 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 spliterator
        atom - never split beyond
    • Method Detail

      • 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
      • subSpliterator

        protected abstract C subSpliterator​(org.apache.commons.lang3.Range<Long> range)
        Override to create a new sub-spliterator per specified range.
        Parameters:
        range - the sub-range
        Returns:
        the concrete sub-spliterator