Class IterableInterval<E extends java.lang.Comparable<E>,​S,​U,​ME extends IterableInterval<E,​S,​U,​ME>>

    • Field Detail

      • _step

        private S _step
      • _unit

        private U _unit
    • Constructor Detail

      • IterableInterval

        public IterableInterval​(E left,
                                E right,
                                S step)
      • IterableInterval

        public IterableInterval​(E left,
                                E right,
                                S step,
                                U unit,
                                boolean bLeftClosed,
                                boolean bRightClosed,
                                boolean bReverse)
    • Method Detail

      • getStep

        public S getStep()
        Specified by:
        getStep in interface IIterableInterval<E extends java.lang.Comparable<E>,​S,​U,​ME extends IterableInterval<E,​S,​U,​ME>>
        Returns:
        The step (or increment) by which this interval visits elements in its set. Returns null if this interval cannot iterate its elements.

        For instance, if the interval is a set of decimal values, say [1..10], the step might be a decimal increment, say 0.25. Similarly, if the interval is simply a set of integers the step might also be an integer value, typically 1. Considering a date interval, say [4/5/10..5/20/10], the step could be expressed in terms of a unit of time e.g., 10 seconds, 1 minute, 2 weeks, etc.

        Note if non-null, the step is a positive (or absolute) increment. To iterate the interval in reverse order use iterateFromRight().