Package org.teavm.classlib.java.util
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
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.teavm.classlib.java.lang.TObject
clone, equals, equals0, finalize, getClass0, hashCode, notify0, notifyAll0, toString, wait0, wait0, waitImpl
Methods inherited from interface org.teavm.classlib.java.util.random.TRandomGenerator
doubles, doubles, doubles, doubles, ints, ints, ints, ints, isDeprecated, longs, longs, longs, longs, nextBoolean, nextBytes, nextDouble, nextDouble, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
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 interfaceTRandomGenerator
-
nextInt
public int nextInt(int n) - Specified by:
nextInt
in interfaceTRandomGenerator
-
nextLong
public long nextLong()- Specified by:
nextLong
in interfaceTRandomGenerator
-
nextFloat
public float nextFloat()- Specified by:
nextFloat
in interfaceTRandomGenerator
-
nextDouble
public double nextDouble()- Specified by:
nextDouble
in interfaceTRandomGenerator
-
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 interfaceTRandomGenerator
-