NumberRange for Doubles.
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 | DoubleRange(final Double
the first element, not null number1, final Double the second element, not null number2)Creates an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public double | 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 DoubleRange | Returns: the range object, not null.the first value that defines the edge of the range, inclusive. fromInclusive, final double the second value that defines the edge of the range, inclusive. toInclusive)Hides org. Creates a range with the specified minimum and maximum values (both inclusive). |
| public static DoubleRange | Returns: the range object, not null.the first value that defines the edge of the range, inclusive. fromInclusive, final Double the second value that defines the edge of the range, inclusive. toInclusive)Hides org. Creates a range with the specified minimum and maximum values (both inclusive). |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| DoubleRange | back to summary |
|---|---|
| private DoubleRange(final Double number1, final Double number2) Creates an instance.
| |
| fit | back to summary |
|---|---|
| public double fit(final double 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 DoubleRange of(final double fromInclusive, final double toInclusive) Hides org. Creates a 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 DoubleRange of(final Double fromInclusive, final Double toInclusive) Hides org. Creates a 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.
| |