T
- The value of the range.tech.uom.lib.common.function.MaximumSupplier<T>
, tech.uom.lib.common.function.MinimumSupplier<T>
QuantityRange
public abstract class Range<T> extends Object implements tech.uom.lib.common.function.MinimumSupplier<T>, tech.uom.lib.common.function.MaximumSupplier<T>
T
items that represent a range of values.
Subclasses of Range should be immutable.
Modifier | Constructor | Description |
---|---|---|
protected |
Range(T min,
T max) |
Construct an instance of Range with a min and max value.
|
protected |
Range(T min,
T max,
T res) |
Construct an instance of Range with a min, max and res value.
|
Modifier and Type | Method | Description |
---|---|---|
abstract boolean |
contains(T t) |
Checks whether the given
T is within this range |
boolean |
equals(Object obj) |
|
T |
getMaximum() |
Returns the largest value of the range.
|
T |
getMinimum() |
Returns the smallest value of the range.
|
T |
getResolution() |
Returns the resolution of the range.
|
int |
hashCode() |
|
boolean |
hasMaximum() |
Method to easily check if
getMaximum() is not null . |
boolean |
hasMinimum() |
Method to easily check if
getMinimum() is not null . |
String |
toString() |
protected Range(T min, T max, T res)
min
- The minimum value for the range.max
- The maximum value for the range.res
- The resolution of the range.public T getMinimum()
getMinimum
in interface tech.uom.lib.common.function.MinimumSupplier<T>
public T getMaximum()
getMaximum
in interface tech.uom.lib.common.function.MaximumSupplier<T>
public T getResolution()
public boolean hasMinimum()
getMinimum()
is not null
.true
if getMinimum()
is not null
.public boolean hasMaximum()
getMaximum()
is not null
.true
if getMaximum()
is not null
.public abstract boolean contains(T t)
T
is within this ranget
- Copyright © 2005–2020 Units of Measurement project. All rights reserved.