public final class LongRange extends NumberRange<Long>
NumberRange for Longs.
This class is not designed to interoperate with other NumberRanges
| Modifier and Type | Method and Description |
|---|---|
static LongRange |
of(long fromInclusive,
long toInclusive)
Creates a closed range with the specified minimum and maximum values (both inclusive).
|
static LongRange |
of(Long fromInclusive,
Long toInclusive)
Creates a closed range with the specified minimum and maximum values (both inclusive).
|
LongStream |
toLongStream()
Returns a sequential ordered
LongStream from Range.getMinimum() (inclusive) to Range.getMaximum() (inclusive) by an incremental step of
1. |
between, between, contains, containsRange, elementCompareTo, equals, fit, getComparator, getMaximum, getMinimum, hashCode, intersectionWith, is, is, isAfter, isAfterRange, isBefore, isBeforeRange, isEndedBy, isNaturalOrdering, isOverlappedBy, isStartedBy, of, toString, toStringpublic static LongRange of(long fromInclusive, long toInclusive)
The range uses the natural ordering of the elements to determine where values lie in the range.
The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.
fromInclusive - the first value that defines the edge of the range, inclusive.toInclusive - the second value that defines the edge of the range, inclusive.public static LongRange of(Long fromInclusive, Long toInclusive)
The range uses the natural ordering of the elements to determine where values lie in the range.
The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.
fromInclusive - the first value that defines the edge of the range, inclusive.toInclusive - the second value that defines the edge of the range, inclusive.IllegalArgumentException - if either element is null.public LongStream toLongStream()
LongStream from Range.getMinimum() (inclusive) to Range.getMaximum() (inclusive) by an incremental step of
1.LongStream for the range of long elementsCopyright © 2001–2025 The Apache Software Foundation. All rights reserved.