@ThreadSafe public class GeneratorRandom extends Object
| Constructor and Description |
|---|
GeneratorRandom()
Creates a new generator random using a random seed
|
GeneratorRandom(long seed)
Creates a new seeded generator random
|
| Modifier and Type | Method and Description |
|---|---|
GeneratorRandom |
fork()
Forks the random using a new random seed generated from this random
|
GeneratorRandom |
fork(long seed)
Forks the random using the provided sed
|
long |
scaleUnder(long end,
long min,
long max)
Scales the next random long between the given min and max values
|
long |
seed()
Obtains the seed used to generate the random longs
|
long |
under(long end)
Obtains the next long between 0 and the upper limit (inclusive)
|
public GeneratorRandom()
public GeneratorRandom(long seed)
seed - the seedpublic GeneratorRandom fork()
public GeneratorRandom fork(long seed)
seed - the seed to usepublic long under(long end)
end - the upper boundpublic long scaleUnder(long end, long min, long max)
Helps smooth the random distribution curve
end - the upper random boundmin - the minimummax - the maximumpublic long seed()
Copyright © 2016. All rights reserved.