|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFairness.NumberUtil
public class NumberUtil
NumberUtil provides some numeric utilities. NumberUtil cannot be instantiated.
Method Summary | |
---|---|
static int |
getDigit(int num,
int digit)
Returns a single hex digit from an integer. |
static int |
getRandomWithPrefix(int prefix,
int prefixDigits,
java.util.Random r)
Returns a number that has a fixed prefix but all digits after the prefix are chosen at random. |
static int |
numMatchingPrefix(int a,
int b)
Returns the size of the common hex digit prefix of two integers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getDigit(int num, int digit)
num
- integerdigit
- digit (0 through 7) to return; 0 is the most significant
public static int numMatchingPrefix(int a, int b)
public static int getRandomWithPrefix(int prefix, int prefixDigits, java.util.Random r)
prefix
- prefix to have (such as 0xA)prefixDigits
- number of digits in prefix (such as 1)r
- non-null source of randomness
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |