1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package jsr166y; |
34 |
|
*/ |
35 |
|
public class ThreadLocalRandom extends Random { |
36 |
|
// same constants as Random, but must be redeclared because private |
37 |
< |
private final static long multiplier = 0x5DEECE66DL; |
38 |
< |
private final static long addend = 0xBL; |
39 |
< |
private final static long mask = (1L << 48) - 1; |
37 |
> |
private static final long multiplier = 0x5DEECE66DL; |
38 |
> |
private static final long addend = 0xBL; |
39 |
> |
private static final long mask = (1L << 48) - 1; |
40 |
|
|
41 |
|
/** |
42 |
|
* The random seed. We can't use super.seed. |
107 |
|
* |
108 |
|
* @param least the least value returned |
109 |
|
* @param bound the upper bound (exclusive) |
110 |
+ |
* @return the next value |
111 |
|
* @throws IllegalArgumentException if least greater than or equal |
112 |
|
* to bound |
112 |
– |
* @return the next value |
113 |
|
*/ |
114 |
|
public int nextInt(int least, int bound) { |
115 |
|
if (least >= bound) |