public final class IntRange extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
getMax()
Return the maximum value of the integer range.
|
int |
getMin()
Return the minimum value of the integer range.
|
int |
hashCode() |
static IntRange |
of(int min,
int max)
Create a new
IntRange object with the given min and
max values. |
IntStream |
stream()
|
String |
toString() |
public int getMin()
public int getMax()
public IntStream stream()
IntStream
from getMin()
(inclusive) to getMax()
(exclusive) by an incremental step of
1
.
An equivalent sequence of increasing values can be produced sequentially
using a for
loop as follows:
for (int i = range.getMin(); i < range.getMax(); ++i) {
...
}
IntStream
for the range of int
elementspublic static IntRange of(int min, int max)
IntRange
object with the given min
and
max
values.min
- the lower bound of the integer rangemax
- the upper bound of the integer rangeIntRange
objectIllegalArgumentException
- if min > max
© 2007-2016 Franz Wilhelmstötter (2016-12-26 11:02)