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.RandomClass 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.LoggerLOGGERprivate static java.lang.StringPRNGprivate static java.lang.StringrandomPropertyNameprivate static java.lang.StringrandomPropertySourceprivate java.io.FilerandomSourceprivate java.io.FileInputStreamrandStreamprivate java.lang.Stringsource
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetRandomSourceFromProperties()private voidinit()protected intnext(int bits)private booleantryOneSource(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
-
-