net.sf.colossus.util
Class DevRandom
java.lang.Object
java.util.Random
net.sf.colossus.util.DevRandom
- All Implemented Interfaces:
- java.io.Serializable
public class DevRandom
- extends java.util.Random
Class DevRandom generates random bits (same interface as class Random).
Which random data source to use can be specified by providing a
property called "net.sf.colossus.randomFile" (see randomPropertyName)
or as argument to the constructor.
If no special source is specified or the specified source is unreachable
then it falls back on the regular java Random class.
- Author:
- Romain Dolbeau, David Ripton
- See Also:
- Serialized Form
Methods inherited from class java.util.Random |
nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
private static final java.util.logging.Logger LOGGER
PRNG
private static final java.lang.String PRNG
- See Also:
- Constant Field Values
source
private java.lang.String source
randomSource
private java.io.File randomSource
randStream
private java.io.FileInputStream randStream
randomPropertyName
private static final java.lang.String randomPropertyName
- See Also:
- Constant Field Values
randomPropertySource
private static java.lang.String randomPropertySource
DevRandom
public DevRandom()
DevRandom
public DevRandom(java.lang.String sourcename)
getRandomSourceFromProperties
private java.lang.String getRandomSourceFromProperties()
tryOneSource
private boolean tryOneSource(java.lang.String src)
init
private void init()
next
protected int next(int bits)
- Overrides:
next
in class java.util.Random