Package dev.jorel.commandapi.wrappers
Class DoubleRange
java.lang.Object
dev.jorel.commandapi.wrappers.DoubleRange
-
Constructor Summary
ConstructorsConstructorDescriptionDoubleRange(double low, double high) Constructs a DoubleRange with a lower bound and an upper bound -
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleRangedoubleRangeGreaterThanOrEq(double min) Constructs a DoubleRange with a given lower bound and no upper boundstatic DoubleRangedoubleRangeLessThanOrEq(double max) Constructs a DoubleRange with a given upper bound and no lower boundbooleandoubleThe lower bound of this range.doubleThe upper bound of this range.inthashCode()booleanisInRange(double f) Determines if a double is within range of the lower bound (inclusive) and the upper bound (inclusive).toString()Converts this DoubleRange to a Minecraft string for use with arguments
-
Constructor Details
-
DoubleRange
public DoubleRange(double low, double high) Constructs a DoubleRange with a lower bound and an upper bound- Parameters:
low- the lower bound of this rangehigh- the upper bound of this range
-
-
Method Details
-
doubleRangeGreaterThanOrEq
Constructs a DoubleRange with a given lower bound and no upper bound- Parameters:
min- the lower bound of this range- Returns:
- a DoubleRange min..
-
doubleRangeLessThanOrEq
Constructs a DoubleRange with a given upper bound and no lower bound- Parameters:
max- the upper bound of this range- Returns:
- a DoubleRange ..max
-
getLowerBound
public double getLowerBound()The lower bound of this range.- Returns:
- the lower bound of this range
-
getUpperBound
public double getUpperBound()The upper bound of this range.- Returns:
- the upper bound of this range
-
isInRange
public boolean isInRange(double f) Determines if a double is within range of the lower bound (inclusive) and the upper bound (inclusive).- Parameters:
f- the double to check within range- Returns:
- true if the given double is within the declared range
-
toString
-
hashCode
-
equals
-