public static class IntegerSequence.Range
extends java.lang.Object
implements java.lang.Iterable<java.lang.Integer>
| Modifier and Type | Field and Description |
|---|---|
private int |
max
Final value.
|
private int |
size
Number of integers contained in this range.
|
private int |
start
First value.
|
private int |
step
Increment.
|
| Constructor and Description |
|---|
IntegerSequence.Range(int start,
int max,
int step)
Creates a sequence \( a_i, i < 0 <= n \)
where \( a_i = start + i * step \)
and \( n \) is such that \( a_n <= max \) and \( a_{n+1} > max \).
|
private final int size
private final int start
private final int max
private final int step
public IntegerSequence.Range(int start,
int max,
int step)
start - First value of the range.max - Last value of the range that satisfies the above
construction rule.step - Increment.Copyright (c) 2003-2017 Apache Software Foundation