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
- Direct Known Subclasses:
TThreadLocalRandom
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubles()
doubles(double randomNumberOrigin, double randomNumberBound)
doubles(long streamSize)
doubles(long streamSize, double randomNumberOrigin, double randomNumberBound)
ints()
ints(int randomNumberOrigin, int randomNumberBound)
ints(long streamSize)
ints(long streamSize, int randomNumberOrigin, int randomNumberBound)
longs()
longs(long streamSize)
longs(long randomNumberOrigin, long randomNumberBound)
longs(long streamSize, long randomNumberOrigin, long randomNumberBound)
protected int
next(int bits)
boolean
void
nextBytes(byte[] bytes)
double
float
double
Generate a random number with Gaussian distribution: centered around 0 with a standard deviation of 1.0.int
nextInt()
int
nextInt(int n)
long
nextLong()
void
setSeed(long seed)
-
Constructor Details
-
TRandom
public TRandom() -
TRandom
public TRandom(long seed)
-
-
Method Details
-
setSeed
public void setSeed(long seed) -
next
protected int next(int bits) -
nextBytes
public void nextBytes(byte[] bytes) -
nextInt
public int nextInt() -
nextInt
public int nextInt(int n) -
nextLong
public long nextLong() -
nextBoolean
public boolean nextBoolean() -
nextFloat
public float nextFloat() -
nextDouble
public double nextDouble() -
nextGaussian
public double nextGaussian()Generate a random number with Gaussian distribution: centered around 0 with a standard deviation of 1.0. -
ints
-
ints
-
ints
-
ints
-
longs
-
longs
-
longs
-
longs
-
doubles
-
doubles
-
doubles
-
doubles
-