CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.wrappers.IntegerRange Class Reference

A class representing a range of integers. More...

Public Member Functions

 IntegerRange (int low, int high)
 Constructs an IntegerRange with a lower bound and an upper bound. More...
 
int getLowerBound ()
 The lower bound of this range. More...
 
int getUpperBound ()
 The upper bound of this range. More...
 
boolean isInRange (int i)
 Determines if an int is within range of the lower bound (inclusive) and the upper bound (inclusive). More...
 
String toString ()
 Converts this IntegerRange to a Minecraft string for use with arguments. More...
 
int hashCode ()
 
boolean equals (Object obj)
 

Static Public Member Functions

static IntegerRange integerRangeGreaterThanOrEq (int min)
 Constructs an IntegerRange with a given lower bound and no upper bound. More...
 
static IntegerRange integerRangeLessThanOrEq (int max)
 Constructs a IntegerRange with a given upper bound and no lower bound. More...
 

Detailed Description

A class representing a range of integers.

Constructor & Destructor Documentation

◆ IntegerRange()

dev.jorel.commandapi.wrappers.IntegerRange.IntegerRange ( int  low,
int  high 
)

Constructs an IntegerRange with a lower bound and an upper bound.

Parameters
lowthe lower bound of this range
highthe upper bound of this range

Member Function Documentation

◆ getLowerBound()

int dev.jorel.commandapi.wrappers.IntegerRange.getLowerBound ( )

The lower bound of this range.

Returns
the lower bound of this range

◆ getUpperBound()

int dev.jorel.commandapi.wrappers.IntegerRange.getUpperBound ( )

The upper bound of this range.

Returns
the upper bound of this range

◆ integerRangeGreaterThanOrEq()

static IntegerRange dev.jorel.commandapi.wrappers.IntegerRange.integerRangeGreaterThanOrEq ( int  min)
static

Constructs an IntegerRange with a given lower bound and no upper bound.

Parameters
minthe lower bound of this range
Returns
an IntegerRange min..

◆ integerRangeLessThanOrEq()

static IntegerRange dev.jorel.commandapi.wrappers.IntegerRange.integerRangeLessThanOrEq ( int  max)
static

Constructs a IntegerRange with a given upper bound and no lower bound.

Parameters
maxthe upper bound of this range
Returns
a IntegerRange ..max

◆ isInRange()

boolean dev.jorel.commandapi.wrappers.IntegerRange.isInRange ( int  i)

Determines if an int is within range of the lower bound (inclusive) and the upper bound (inclusive).

Parameters
ithe int to check within range
Returns
true if the given int is within the declared range

◆ toString()

String dev.jorel.commandapi.wrappers.IntegerRange.toString ( )

Converts this IntegerRange to a Minecraft string for use with arguments.

Returns
a Minecraft string for use with arguments