com.google.gwt.user.client
Class Random

java.lang.Object
  extended bycom.google.gwt.user.client.Random

public final class Random
extends Object

This class can be used as a substitute for Random. 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.


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Method Summary
static boolean nextBoolean()
          Returns true or false with roughly equal probability.
static double nextDouble()
          Returns a random double between 0 (inclusive) and 1 (exclusive).
static int nextInt()
          Returns a random int between -2147483648 and 2147483647 (inclusive) with roughly equal probability of returning any particular int in this range.
static int nextInt(int upperBound)
          Returns a random int between 0 (inclusive) and upperBound (exclusive) with roughly equal probability of returning any particular int in this range.
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode, toString
 

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 random double between 0 (inclusive) and 1 (exclusive). The underlying browser's random implementation is used.


nextInt

public static int nextInt()
Returns a random int between -2147483648 and 2147483647 (inclusive) with roughly equal probability of returning any particular int in this range. The underlying browser's random implementation is used.


nextInt

public static int nextInt(int upperBound)
Returns a random int between 0 (inclusive) and upperBound (exclusive) with roughly equal probability of returning any particular int in this range. The underlying browser's random implementation is used.



This javadoc distribution was not produced by Google. The official documentation is here.