Class IntegerSequence.Range
- java.lang.Object
-
- org.apache.commons.math4.legacy.core.IntegerSequence.Range
-
- Enclosing class:
- IntegerSequence
public static class IntegerSequence.Range extends Object implements Iterable<Integer>
Generates a sequence of integers.
-
-
Constructor Summary
Constructors Constructor Description Range(int start, int max, int step)
Creates a sequenceai, i < 0 < n
whereai = start + i * step
andn
is such thatan <= max
andan+1 > max
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<Integer>
iterator()
int
size()
Gets the number of elements contained in the range.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
Range
public Range(int start, int max, int step)
Creates a sequenceai, i < 0 < n
whereai = start + i * step
andn
is such thatan <= max
andan+1 > max
.- Parameters:
start
- First value of the range.max
- Last value of the range that satisfies the above construction rule.step
- Increment.
-
-