NumberRange for Integers.
This class is not designed to interoperate with other NumberRanges
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| private | IntegerRange(final Integer
the first element, not null number1, final Integer the second element, not null number2)Creates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the minimum, the element, or the maximum depending on the element's location relative to the range.the element to test. element)Overrides org. Fits the given value into this range by returning the given value or, if out of bounds, the range minimum if below, or the range maximum if above. |
| public static IntegerRange | Returns: the range object, not null.the first value that defines the edge of the range, inclusive. fromInclusive, final int the second value that defines the edge of the range, inclusive. toInclusive)Hides org. Creates a closed range with the specified minimum and maximum values (both inclusive). |
| public static IntegerRange | Returns: the range object, not null.the first value that defines the edge of the range, inclusive. fromInclusive, final Integer the second value that defines the edge of the range, inclusive. toInclusive)Hides org. Creates a closed range with the specified minimum and maximum values (both inclusive). |
| public IntStream | Returns: a sequentialIntStream for the range of int elementsReturns a sequential ordered |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| IntegerRange | back to summary |
|---|---|
| private IntegerRange(final Integer number1, final Integer number2) Creates a new instance.
| |
| fit | back to summary |
|---|---|
| public int fit(final int element) Overrides org. Fits the given value into this range by returning the given value or, if out of bounds, the range minimum if below, or the range maximum if above.
| |
| of | back to summary |
|---|---|
| public static IntegerRange of(final int fromInclusive, final int toInclusive) Hides org. Creates a closed range with the specified minimum and maximum values (both inclusive). 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.
| |
| of | back to summary |
|---|---|
| public static IntegerRange of(final Integer fromInclusive, final Integer toInclusive) Hides org. Creates a closed range with the specified minimum and maximum values (both inclusive). 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.
| |
| toIntStream | back to summary |
|---|---|
| public IntStream toIntStream() Returns a sequential ordered
| |