Package dev.jorel.commandapi.wrappers
Class IntegerRange
java.lang.Object
dev.jorel.commandapi.wrappers.IntegerRange
A class representing a range of integers
-
Constructor Summary
ConstructorsConstructorDescriptionIntegerRange(int low, int high) Constructs an IntegerRange with a lower bound and an upper bound -
Method Summary
Modifier and TypeMethodDescriptionbooleanintThe lower bound of this range.intThe upper bound of this range.inthashCode()static IntegerRangeintegerRangeGreaterThanOrEq(int min) Constructs an IntegerRange with a given lower bound and no upper boundstatic IntegerRangeintegerRangeLessThanOrEq(int max) Constructs a IntegerRange with a given upper bound and no lower boundbooleanisInRange(int i) Determines if an int is within range of the lower bound (inclusive) and the upper bound (inclusive).toString()Converts this IntegerRange to a Minecraft string for use with arguments
-
Constructor Details
-
IntegerRange
public IntegerRange(int low, int high) Constructs an IntegerRange with a lower bound and an upper bound- Parameters:
low- the lower bound of this rangehigh- the upper bound of this range
-
-
Method Details
-
integerRangeGreaterThanOrEq
Constructs an IntegerRange with a given lower bound and no upper bound- Parameters:
min- the lower bound of this range- Returns:
- an IntegerRange min..
-
integerRangeLessThanOrEq
Constructs a IntegerRange with a given upper bound and no lower bound- Parameters:
max- the upper bound of this range- Returns:
- a IntegerRange ..max
-
getLowerBound
public int getLowerBound()The lower bound of this range.- Returns:
- the lower bound of this range
-
getUpperBound
public int getUpperBound()The upper bound of this range.- Returns:
- the upper bound of this range
-
isInRange
public boolean isInRange(int i) Determines if an int is within range of the lower bound (inclusive) and the upper bound (inclusive).- Parameters:
i- the int to check within range- Returns:
- true if the given int is within the declared range
-
toString
Converts this IntegerRange to a Minecraft string for use with arguments -
hashCode
public int hashCode() -
equals
-