Package com.google.gwt.user.client
Class Random
- java.lang.Object
-
- com.google.gwt.user.client.Random
-
public final class Random extends java.lang.ObjectThis class can be used as a substitute forRandom. The semantics differ in that the underlying browser's implementation is used. The random generator cannot be seeded or otherwise used to reproduce a particular sequence of results.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleannextBoolean()Returns true or false with roughly equal probability.static doublenextDouble()Returns a randomdoublebetween 0 (inclusive) and 1 (exclusive).static intnextInt()Returns a randomintbetween -2147483648 and 2147483647 (inclusive) with roughly equal probability of returning any particularintin this range.static intnextInt(int upperBound)Returns a randomintbetween 0 (inclusive) andupperBound(exclusive) with roughly equal probability of returning any particularintin this range.
-
-
-
Method Detail
-
nextBoolean
public static boolean nextBoolean()
Returns true or false with roughly equal probability. The underlying browser's random implementation is used.
-
nextDouble
public static double nextDouble()
Returns a randomdoublebetween 0 (inclusive) and 1 (exclusive). The underlying browser's random implementation is used.
-
nextInt
public static int nextInt()
Returns a randomintbetween -2147483648 and 2147483647 (inclusive) with roughly equal probability of returning any particularintin this range. The underlying browser's random implementation is used.
-
nextInt
public static int nextInt(int upperBound)
Returns a randomintbetween 0 (inclusive) andupperBound(exclusive) with roughly equal probability of returning any particularintin this range. The underlying browser's random implementation is used.
-
-