public static class Debug.Random extends java.util.Random implements java.io.Serializable, RevisionHandler
| Constructor and Description |
|---|
Random()
Creates a new random number generator.
|
Random(boolean debug)
Creates a new random number generator.
|
Random(long seed)
Creates a new random number generator using a single long seed.
|
Random(long seed,
boolean debug)
Creates a new random number generator using a single long seed.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getDebug()
returns whether to print the generated random values or not
|
long |
getID()
returns the unique ID of this number generator
|
Debug.Log |
getLog()
the currently used log, if null then stdout is used for outputting
the debugging information
|
java.lang.String |
getRevision()
Returns the revision string.
|
boolean |
nextBoolean()
Returns the next pseudorandom, uniformly distributed boolean value from
this random number generator's sequence.
|
void |
nextBytes(byte[] bytes)
Generates random bytes and places them into a user-supplied byte array.
|
double |
nextDouble()
Returns the next pseudorandom, uniformly distributed double value between
0.0 and 1.0 from this random number generator's sequence.
|
float |
nextFloat()
Returns the next pseudorandom, uniformly distributed float value between
0.0 and 1.0 from this random number generator's sequence.
|
double |
nextGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed double
value with mean 0.0 and standard deviation 1.0 from this random number
generator's sequence.
|
int |
nextInt()
Returns the next pseudorandom, uniformly distributed int value from this
random number generator's sequence.
|
int |
nextInt(int n)
Returns a pseudorandom, uniformly distributed int value between 0
(inclusive) and the specified value (exclusive), drawn from this random
number generator's sequence.
|
long |
nextLong()
Returns the next pseudorandom, uniformly distributed long value from this
random number generator's sequence.
|
void |
printStackTrace()
prints the current stacktrace
|
void |
setDebug(boolean value)
sets whether to print the generated random values or not
|
void |
setLog(Debug.Log value)
the log to use, if it is null then stdout is used
|
void |
setSeed(long seed)
Sets the seed of this random number generator using a single long seed.
|
java.lang.String |
toString()
returns a string representation of this number generator
|
public Random()
public Random(long seed)
seed - the seed valuepublic Random(boolean debug)
debug - if true, debugging output is enabledpublic Random(long seed,
boolean debug)
seed - the seed valuedebug - if true, debugging output is enabledpublic void setDebug(boolean value)
value - if true debugging output is enabledpublic boolean getDebug()
public void setLog(Debug.Log value)
value - the log to usepublic Debug.Log getLog()
public long getID()
public void printStackTrace()
public boolean nextBoolean()
nextBoolean in class java.util.Randompublic void nextBytes(byte[] bytes)
nextBytes in class java.util.Randombytes - array to fill with random bytespublic double nextDouble()
nextDouble in class java.util.Randompublic float nextFloat()
nextFloat in class java.util.Randompublic double nextGaussian()
nextGaussian in class java.util.Randompublic int nextInt()
nextInt in class java.util.Randompublic int nextInt(int n)
nextInt in class java.util.Randomn - the upper limit (exclusive)public long nextLong()
nextLong in class java.util.Randompublic void setSeed(long seed)
setSeed in class java.util.Randomseed - the seed valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandler