Class RandomMersenne

  • All Implemented Interfaces:
    java.io.Serializable

    public class RandomMersenne
    extends java.util.Random
    Better than java.util.Random and almost as fast
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
      private long u  
      private long v  
      private long w  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int next​(int bits)  
      long nextLong()  
      void setSeed​(long seed)  
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • u

        private long u
      • v

        private long v
      • w

        private long w
    • Constructor Detail

      • RandomMersenne

        public RandomMersenne()
      • RandomMersenne

        public RandomMersenne​(long seed)
    • Method Detail

      • nextLong

        public long nextLong()
        Overrides:
        nextLong in class java.util.Random
      • next

        protected int next​(int bits)
        Overrides:
        next in class java.util.Random
      • setSeed

        public void setSeed​(long seed)
        Overrides:
        setSeed in class java.util.Random