Class IntegerSequence
- java.lang.Object
-
- org.apache.commons.math4.legacy.core.IntegerSequence
-
public final class IntegerSequence extends Object
Provides a sequence of integers.- Since:
- 3.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntegerSequence.IncrementorUtility that increments a counter until a maximum is reached, at which point, the instance will by default throw aMaxCountExceededException.static classIntegerSequence.RangeGenerates a sequence of integers.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntegerSequence.Rangerange(int start, int end)Creates a sequence[start .. end].static IntegerSequence.Rangerange(int start, int max, int step)Creates a sequenceai, i < 0 < nwhereai = start + i * stepandnis such thatan <= maxandan+1 > max.
-
-
-
Method Detail
-
range
public static IntegerSequence.Range range(int start, int end)
Creates a sequence[start .. end]. It callsrange(start, end, 1).- Parameters:
start- First value of the range.end- Last value of the range.- Returns:
- a range.
-
range
public static IntegerSequence.Range range(int start, int max, int step)
Creates a sequenceai, i < 0 < nwhereai = start + i * stepandnis such thatan <= maxandan+1 > max.- Parameters:
start- First value of the range.max- Last value of the range that satisfies the above construction rule.step- Increment.- Returns:
- a range.
-
-