Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      DevRandom()  
      DevRandom​(java.lang.String sourcename)  
    • 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)  
      • Methods inherited from class java.util.Random

        doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, 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
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • 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
    • Constructor Detail

      • DevRandom

        public DevRandom()
      • DevRandom

        public DevRandom​(java.lang.String sourcename)
    • Method Detail

      • 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