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 intnext(int bits) booleanvoidnextBytes(byte[] bytes) doubledoublenextDouble(double bound) doublenextDouble(double origin, double bound) floatfloatnextFloat(float bound) floatnextFloat(float origin, float bound) doubleGenerate a random number with Gaussian distribution: centered around 0 with a standard deviation of 1.0.intnextInt()intnextInt(int n) intnextInt(int origin, int bound) longnextLong()longnextLong(long bound) longnextLong(long origin, long bound) voidsetSeed(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) -
nextInt
public int nextInt(int origin, int bound) -
nextLong
public long nextLong() -
nextLong
public long nextLong(long bound) -
nextLong
public long nextLong(long origin, long bound) -
nextBoolean
public boolean nextBoolean() -
nextFloat
public float nextFloat() -
nextFloat
public float nextFloat(float bound) -
nextFloat
public float nextFloat(float origin, float bound) -
nextDouble
public double nextDouble() -
nextDouble
public double nextDouble(double bound) -
nextDouble
public double nextDouble(double origin, double bound) -
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
-