Package net.minestom.server.utils.math
Class Range<T>
java.lang.Object
net.minestom.server.utils.math.Range<T>
- Type Parameters:
T
- The type numeric of the range object.
- Direct Known Subclasses:
ByteRange
,DoubleRange
,FloatRange
,IntRange
,LongRange
,ShortRange
Represents the base for any data type that is numeric.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieves the maximum value of the range.Retrieves the minimum value of the range.int
hashCode()
abstract boolean
Whether the givenvalue
is in range of the minimum and the maximum.void
setMaximum
(T maximum) Changes the maximum value of the range.void
setMinimum
(T minimum) Changes the minimum value of the range.
-
Constructor Details
-
Range
- Parameters:
minimum
- The minimum of the range.maximum
- The maximum of the range.
-
Range
Constructs a newRange
with thevalue
.- Parameters:
value
- The value of the range.
-
-
Method Details
-
getMinimum
Retrieves the minimum value of the range.- Returns:
- The range's minimum value.
-
setMinimum
Changes the minimum value of the range.- Parameters:
minimum
- The new minimum value.
-
getMaximum
Retrieves the maximum value of the range.- Returns:
- The range's maximum value.
-
setMaximum
Changes the maximum value of the range.- Parameters:
maximum
- The new maximum value.
-
isInRange
Whether the givenvalue
is in range of the minimum and the maximum.- Parameters:
value
- The value to be checked.- Returns:
true
if the value in the range ofminimum
andmaximum
, otherwisefalse
.
-
equals
-
hashCode
public int hashCode()
-