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 TObject
clone, equals, equals0, finalize, getClass0, hashCode, notify0, notifyAll0, toString, wait0, wait0Methods inherited from interface 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:
nextIntin interfaceTRandomGenerator
-
nextInt
public int nextInt(int n) - Specified by:
nextIntin interfaceTRandomGenerator
-
nextLong
public long nextLong()- Specified by:
nextLongin interfaceTRandomGenerator
-
nextFloat
public float nextFloat()- Specified by:
nextFloatin interfaceTRandomGenerator
-
nextDouble
public double nextDouble()- Specified by:
nextDoublein interfaceTRandomGenerator
-
nextGaussian
public double nextGaussian()Generate a random number with Gaussian distribution: centered around 0 with a standard deviation of 1.0.- Specified by:
nextGaussianin interfaceTRandomGenerator
-