public final class LongRange extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
long |
getMax()
Return the maximum value of the long range.
|
long |
getMin()
Return the minimum value of the long range.
|
int |
hashCode() |
static LongRange |
of(long value)
Return a new (half open) range, which contains only the given value:
[value, value + 1) . |
static LongRange |
of(long min,
long max)
Create a new
LongRange object with the given min and
max values. |
LongStream |
stream()
|
String |
toString() |
public long getMin()
public long getMax()
public LongStream stream()
LongStream
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 (long i = range.getMin(); i < range.getMax(); ++i) {
...
}
LongStream
for the range of long
elementspublic static LongRange of(long min, long max)
LongRange
object with the given min
and
max
values.min
- the lower bound of the long rangemax
- the upper bound of the long rangeLongRange
objectIllegalArgumentException
- if min > max
public static LongRange of(long value)
[value, value + 1)
.value
- the value of the created (half open) integer range© 2007-2019 Franz Wilhelmstötter (2019-02-19 21:44)