Class TRandom

java.lang.Object
org.teavm.classlib.java.lang.TObject
org.teavm.classlib.java.util.TRandom
All Implemented Interfaces:
TSerializable, TRandomGenerator
Direct Known Subclasses:
TSecureRandom, TThreadLocalRandom

public class TRandom extends TObject implements TRandomGenerator, TSerializable
  • Constructor Details

    • TRandom

      public TRandom()
    • TRandom

      public TRandom(long seed)
  • Method Details

    • setSeed

      public void setSeed(long seed)
    • nextInt

      public int nextInt()
      Specified by:
      nextInt in interface TRandomGenerator
    • next

      protected int next(int bits)
    • nextLong

      public long nextLong()
      Specified by:
      nextLong in interface TRandomGenerator
    • nextFloat

      public float nextFloat()
      Specified by:
      nextFloat in interface TRandomGenerator
    • nextDouble

      public double nextDouble()
      Specified by:
      nextDouble in interface TRandomGenerator
    • nextGaussian

      public double nextGaussian()
      Generate a random number with Gaussian distribution: centered around 0 with a standard deviation of 1.0.
      Specified by:
      nextGaussian in interface TRandomGenerator