java.lang.Object | |
↳ | com.google.gwt.user.client.Random |
This class can be used as a substitute for java.util.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.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns true or false with roughly equal probability.
| |||||||||||
Returns a random
double between 0 (inclusive) and 1
(exclusive). | |||||||||||
Returns a random
int between 0 (inclusive) and
upperBound (exclusive) with roughly equal probability of
returning any particular int in this range. | |||||||||||
Returns a random
int between -2147483648 and 2147483647
(inclusive) with roughly equal probability of returning any particular
int in this range. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns true or false with roughly equal probability. The underlying browser's random implementation is used.
Returns a random double
between 0 (inclusive) and 1
(exclusive). The underlying browser's random implementation is used.
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.
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.