Package 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
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOGGER
private static java.lang.String
PRNG
private static java.lang.String
randomPropertyName
private static java.lang.String
randomPropertySource
private java.io.File
randomSource
private java.io.FileInputStream
randStream
private java.lang.String
source
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
getRandomSourceFromProperties()
private void
init()
protected int
next(int bits)
private boolean
tryOneSource(java.lang.String src)
-
-
-
Field Detail
-
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
-
-