Class IntegerSequence
java.lang.Object
org.apache.commons.math3.util.IntegerSequence
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUtility that increments a counter until a maximum is reached, at which point, the instance will by default throw aMaxCountExceededException.static classGenerates a sequence of integers. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUtility class contains only static methods. -
Method Summary
Modifier and TypeMethodDescriptionstatic IntegerSequence.Rangerange(int start, int end) Creates a sequence[start .. end].static IntegerSequence.Rangerange(int start, int max, int step) Creates a sequence \( a_i, i invalid input: '<' 0 invalid input: '<'= n \) where \( a_i = start + i * step \) and \( n \) is such that \( a_n invalid input: '<'= max \) and \( a_{n+1} > max \).
-
Constructor Details
-
IntegerSequence
private IntegerSequence()Utility class contains only static methods.
-
-
Method Details
-
range
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
Creates a sequence \( a_i, i invalid input: '<' 0 invalid input: '<'= n \) where \( a_i = start + i * step \) and \( n \) is such that \( a_n invalid input: '<'= max \) and \( a_{n+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.
-