T
- The type of the min and maxvalues.public class ValueRange<T extends Comparable<T>> extends Object
Constructor and Description |
---|
ValueRange()
Creates a new instance of the
ValueRange class. |
ValueRange(T min,
T max)
Creates a new instance of the
ValueRange class with the specified min and max values. |
Modifier and Type | Method and Description |
---|---|
ValueRange<T> |
clone() |
boolean |
equals(Object o) |
T |
getMaximum()
Gets the maximum value.
|
T |
getMinimum()
Gets the minimum value.
|
boolean |
isInRangeExclusive(T value)
Determines whether the specified value is within the range, excluding the minimum and maximum values.
|
boolean |
isInRangeInclusive(T value)
Determines whether the specified value is within the range, including its minimum and maximum values.
|
void |
setMaximum(T value)
Sets the maximum value.
|
void |
setMinimum(T value)
Sets the minimum value.
|
public ValueRange()
ValueRange
class.public ValueRange(T min, T max)
ValueRange
class with the specified min and max values.min
- The min value.max
- The max value.public T getMaximum()
public void setMaximum(T value)
value
- The maximum value.public T getMinimum()
public void setMinimum(T value)
value
- The minimum value.public boolean isInRangeExclusive(T value)
value
- The value to check.true
if the value is less than maximum and greater than minimum. false
otherwise.public boolean isInRangeInclusive(T value)
value
- The value to check.true
if the value is less than or equal the maximum and greater than or equal to the minimum. false
otherwise.public ValueRange<T> clone()