Creates a new NumberRange with the same from and to as this IntRange but with a step size of stepSize . @param stepSize the desired step size @return a new NumberRange @since 2.5.0
(T stepSize)
| 235 | * @since 2.5.0 |
| 236 | */ |
| 237 | public <T extends Number & Comparable> NumberRange by(T stepSize) { |
| 238 | return new NumberRange(getFrom(), getTo(), stepSize, true, true); // GROOVY-10496 |
| 239 | } |
| 240 | |
| 241 | private void checkSize() { |
| 242 | // size() in the Collection interface returns an integer, so ranges can have no more than Integer.MAX_VALUE elements |