Top Description Methods
tech.units.indriya.spi

public Interface Range<T>

extends MinimumSupplier<T>, MaximumSupplier<T>
Known Direct Implementers
tech.units.indriya.quantity.QuantityRange
Type Parameters
<T>
The value of the range.
Imports
tech.uom.lib.common.function.MaximumSupplier, .MinimumSupplier

A Range is a pair of T items 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.
Author
Werner Keil
Since
1.0
Version
2.0, August 23, 2023
See Also
Wikipedia: Range

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the value is within the range
contains
(T t)

Checks whether the given T is within this range

public T

Returns:

the maximum value
getMaximum
()

Redeclares tech.uom.lib.common.function.MaximumSupplier.getMaximum.

Returns the largest value of the range.

public T

Returns:

the minimum value
getMinimum
()

Redeclares tech.uom.lib.common.function.MinimumSupplier.getMinimum.

Returns the smallest value of the range.

public T

Returns:

resolution of the range, the value is the same as that given as the constructor parameter for the resolution
getResolution
()

Returns the resolution of the range.

public boolean

Returns:

true if getMaximum() is not null.
hasMaximum
()

Method to easily check if getMaximum() is not null.

public boolean

Returns:

true if getMinimum() is not null .
hasMinimum
()

Method to easily check if getMinimum() is not null.

Method Detail

containsback to summary
public boolean contains(T t)

Checks whether the given T is within this range

Returns:boolean

true if the value is within the range

getMaximumback to summary
public T getMaximum()

Redeclares tech.uom.lib.common.function.MaximumSupplier.getMaximum.

Returns the largest value of the range. The value is the same as that given as the constructor parameter for the largest value.

Returns:T

the maximum value

getMinimumback to summary
public T getMinimum()

Redeclares tech.uom.lib.common.function.MinimumSupplier.getMinimum.

Returns the smallest value of the range. The value is the same as that given as the constructor parameter for the smallest value.

Returns:T

the minimum value

getResolutionback to summary
public 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:T

resolution of the range, the value is the same as that given as the constructor parameter for the resolution

hasMaximumback to summary
public boolean hasMaximum()

Method to easily check if getMaximum() is not null.

Returns:boolean

true if getMaximum() is not null.

hasMinimumback to summary
public boolean hasMinimum()

Method to easily check if getMinimum() is not null.

Returns:boolean

true if getMinimum() is not null .