Class BSDRandom

java.lang.Object
org.metricshub.jawk.jrt.BSDRandom

public class BSDRandom extends Object
Simple pseudo-random number generator compatible with the C library random() function.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BSDRandom(int seed)
    Create a new generator with the specified seed.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Return the next pseudo-random number in the range [0.0,1.0).
    final void
    setSeed(int seed)
    Seed the generator.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BSDRandom

      public BSDRandom(int seed)
      Create a new generator with the specified seed.
  • Method Details

    • setSeed

      public final void setSeed(int seed)
      Seed the generator. A seed of 0 is transformed to 1 as in the original implementation.
    • nextDouble

      public double nextDouble()
      Return the next pseudo-random number in the range [0.0,1.0).