T - The type of value for this range, e.g. a simple value type, like Length.public interface Range<T>
This interface represents (describes) an inclusive range (or "interval") of numeric values of the same type defined by
a minimum and maximum value. The value type for the range can, for instance, be a simple value type, such as
Length and Mass.
A range is defined to contain all the values between the minimum value (see getLowerBound()) and the maximum
value (see getUpperBound()), where the minimum/maximum value (or lower bound/upper bound) are included in the
range.
| Modifier and Type | Method and Description |
|---|---|
T |
getLowerBound() |
T |
getUpperBound() |
boolean |
isWithinRange(T value)
This method will evaluate if the specified value is within the bounds of the range, bounds inclusive.
|
T getLowerBound()
T getUpperBound()
boolean isWithinRange(T value)
This method will evaluate if the specified value is within the bounds of the range, bounds inclusive.
A value is considered to be within the range, ifminimum <= value <= maximum, where minimum and
maximum are the lower endpoint and the upper endpoint of the range, respectively.value - The value to evaluatetrue, if the value is within the range (bounds inclusive), false otherwise.Copyright © 2023. All rights reserved.