Package dev.jorel.commandapi.wrappers
Class FloatRange
java.lang.Object
dev.jorel.commandapi.wrappers.FloatRange
A class representing a range of floats
-
Constructor Summary
ConstructorsConstructorDescriptionFloatRange(float low, float high) Constructs a FloatRange with a lower bound and an upper bound -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic FloatRangefloatRangeGreaterThanOrEq(float min) Constructs a FloatRange with a given lower bound and no upper boundstatic FloatRangefloatRangeLessThanOrEq(float max) Constructs a FloatRange with a given upper bound and no lower boundfloatThe lower bound of this range.floatThe upper bound of this range.inthashCode()booleanisInRange(float f) Determines if a float is within range of the lower bound (inclusive) and the upper bound (inclusive).toString()Converts this FloatRange to a Minecraft string for use with arguments
-
Constructor Details
-
FloatRange
public FloatRange(float low, float high) Constructs a FloatRange with a lower bound and an upper bound- Parameters:
low- the lower bound of this rangehigh- the upper bound of this range
-
-
Method Details
-
floatRangeGreaterThanOrEq
Constructs a FloatRange with a given lower bound and no upper bound- Parameters:
min- the lower bound of this range- Returns:
- a FloatRange min..
-
floatRangeLessThanOrEq
Constructs a FloatRange with a given upper bound and no lower bound- Parameters:
max- the upper bound of this range- Returns:
- a FloatRange ..max
-
getLowerBound
public float getLowerBound()The lower bound of this range.- Returns:
- the lower bound of this range
-
getUpperBound
public float getUpperBound()The upper bound of this range.- Returns:
- the upper bound of this range
-
isInRange
public boolean isInRange(float f) Determines if a float is within range of the lower bound (inclusive) and the upper bound (inclusive).- Parameters:
f- the float to check within range- Returns:
- true if the given float is within the declared range
-
toString
Converts this FloatRange to a Minecraft string for use with arguments -
hashCode
public int hashCode() -
equals
-