|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.mapred.gridmix.RandomAlgorithms.Selector
public static class RandomAlgorithms.Selector
Iteratively pick random numbers from pool 0..n-1. Each number can only be picked once.
Constructor Summary | |
---|---|
RandomAlgorithms.Selector(int n,
double selPcnt,
Random rand)
Constructor. |
Method Summary | |
---|---|
int |
getPoolSize()
Get the remaining random number pool size. |
int |
next()
Select the next random number. |
void |
reset()
Reset the selector for reuse usage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomAlgorithms.Selector(int n, double selPcnt, Random rand)
n
- The pool of integers: 0..n-1.selPcnt
- Percentage of selected numbers. This is just a hint for internal
memory optimization.rand
- Random number generator.Method Detail |
---|
public int next()
public int getPoolSize()
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |