Package tech.units.indriya.spi
Interface Range<T>
-
- Type Parameters:
T- The value of the range.
- All Superinterfaces:
tech.uom.lib.common.function.MaximumSupplier<T>,tech.uom.lib.common.function.MinimumSupplier<T>
- All Known Implementing Classes:
QuantityRange
public interface Range<T> extends tech.uom.lib.common.function.MinimumSupplier<T>, tech.uom.lib.common.function.MaximumSupplier<T>
A Range is a pair ofTitems that represent a range of values.- API Note:
- This interface places no restrictions on the mutability of
implementations, however immutability is strongly recommended. All
implementations should be
Comparable.
- Since:
- 1.0
- Version:
- 2.0, August 23, 2023
- Author:
- Werner Keil
- See Also:
- Wikipedia: Range
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(T t)Checks whether the givenTis within this rangeTgetMaximum()Returns the largest value of the range.TgetMinimum()Returns the smallest value of the range.TgetResolution()Returns the resolution of the range.booleanhasMaximum()Method to easily check ifgetMaximum()is notnull.booleanhasMinimum()Method to easily check ifgetMinimum()is notnull.
-
-
-
Method Detail
-
getMinimum
T getMinimum()
Returns the smallest value of the range. The value is the same as that given as the constructor parameter for the smallest value.- Specified by:
getMinimumin interfacetech.uom.lib.common.function.MinimumSupplier<T>- Returns:
- the minimum value
-
getMaximum
T getMaximum()
Returns the largest value of the range. The value is the same as that given as the constructor parameter for the largest value.- Specified by:
getMaximumin interfacetech.uom.lib.common.function.MaximumSupplier<T>- Returns:
- the maximum value
-
getResolution
T getResolution()
Returns the resolution of the range. The value is the same as that given as the constructor parameter for the largest value.- Returns:
- resolution of the range, the value is the same as that given as the constructor parameter for the resolution
-
hasMinimum
boolean hasMinimum()
Method to easily check ifgetMinimum()is notnull.- Returns:
trueifgetMinimum()is notnull.
-
hasMaximum
boolean hasMaximum()
Method to easily check ifgetMaximum()is notnull.- Returns:
trueifgetMaximum()is notnull.
-
-