Interface IIterableInterval<E extends Comparable<E>, S, U, ME extends IIterableInterval<E,S,U,ME> >
- All Known Implementing Classes:
BigDecimalInterval, BigIntegerInterval, DateInterval, IntegerInterval, IterableInterval, LongInterval, NumberInterval, SequenceableInterval
public interface IIterableInterval<E extends Comparable<E>, S, U, ME extends IIterableInterval<E,S,U,ME>>
extends Iterable<E>, IInterval<E,ME>
-
Method Summary
Methods inherited from interface IInterval
contains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReverse, isRightClosedMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
iterator
-
iterateFromLeft
-
iterateFromRight
-
getStep
S getStep()- 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().
-
step
-
getUnit
U getUnit() -
unit
-
getFromLeft
- Parameters:
iStepIndex- The index of the step from the left endpoint- Returns:
- The nth step from the left endpoint. Returns null if iStepIndex is out of bounds.
-
getFromRight
- Parameters:
iStepIndex- The index of the step from the right endpoint- Returns:
- The nth step from the right endpoint. Returns null if iStepIndex is out of bounds.
-