|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.math.MathUtil
public final class MathUtil
This class contains some mathematic utility methods.
Field Summary | |
---|---|
static java.lang.Integer |
NEGATIVE_ONE
|
static java.lang.Integer |
ZERO
|
Constructor Summary | |
---|---|
MathUtil()
|
Method Summary | |
---|---|
static int |
clamp(int val,
int min,
int max)
Clamp a value to a range. |
static long |
clamp(long val,
long min,
long max)
|
static boolean |
compare(java.lang.Number n1,
java.lang.Number n2)
Like StringUtil.compare, but for numbers. |
static int |
gcd(int n,
int m)
Find the greatest common divisor of both n and
m . |
static int |
lcm(int n,
int m)
Find the least common multiple of n and
m . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Integer NEGATIVE_ONE
public static final java.lang.Integer ZERO
Constructor Detail |
---|
public MathUtil()
Method Detail |
---|
public static int gcd(int n, int m)
n
and
m
.
n
- first numberm
- second number
public static int lcm(int n, int m)
n
and
m
.
n
- first numberm
- second number
public static boolean compare(java.lang.Number n1, java.lang.Number n2)
org.hyperic.util.StringUtil#compare
public static long clamp(long val, long min, long max)
public static int clamp(int val, int min, int max)
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |