|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.utils.MathUtils
public final class MathUtils
This class provides a set of utilities to perform various math operations.
Constructor Summary | |
---|---|
MathUtils()
|
Method Summary | |
---|---|
static int |
limit(int value,
int min,
int max)
Returns value limited by the specified range. |
static int |
max(int... integers)
Returns maximum of the specified integer numbers. |
static int |
min(int... integers)
Returns minimum of the specified integer numbers. |
static int |
random()
Returns random integer number between 0 (inclusive) and 100 (inclusive). |
static int |
random(int... numbers)
Returns random integer number from one the specified integers. |
static int |
random(int cap)
Returns random integer number between 0 (inclusive) and cap (exclusive). |
static int |
random(int min,
int max)
Returns random integer number between min (inclusive) and max (inclusive). |
static float |
sqr(float f)
Returns square for specified float number. |
static int |
sqr(int i)
Returns square for specified integer number. |
static int |
sqrt(double i)
Returns rounded square root for the specified integer number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MathUtils()
Method Detail |
---|
public static int random()
public static int random(int cap)
cap
- random numbers cap
public static int random(int min, int max)
min
- random numbers minimummax
- random numbers maximum
public static int random(int... numbers)
numbers
- number to choose random one from
public static int sqr(int i)
i
- integer number to process
public static float sqr(float f)
f
- float number to process
public static int sqrt(double i)
i
- integer number to process
public static int limit(int value, int min, int max)
value
- value to limitmin
- range minimummax
- range maximum
public static int max(int... integers)
integers
- integer numbers to process
public static int min(int... integers)
integers
- integer numbers to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |