public final class IntegerRange extends NumberRange<Integer>
NumberRange for Integers.
This class is not designed to interoperate with other NumberRanges
| Modifier and Type | Method and Description |
|---|---|
static IntegerRange |
of(Integer fromInclusive,
Integer toInclusive)
Creates a closed range with the specified minimum and maximum values (both inclusive).
|
static IntegerRange |
of(int fromInclusive,
int toInclusive)
Creates a closed range with the specified minimum and maximum values (both inclusive).
|
IntStream |
toIntStream()
Returns a sequential ordered
IntStream 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 IntegerRange of(int fromInclusive, int 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 IntegerRange of(Integer fromInclusive, Integer 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 IntStream toIntStream()
IntStream from Range.getMinimum() (inclusive) to Range.getMaximum() (inclusive) by an incremental step of
1.IntStream for the range of int elementsCopyright © 2001–2025 The Apache Software Foundation. All rights reserved.