230 |
|
* Returns hash of local host IP address, if available; else 0. |
231 |
|
*/ |
232 |
|
private static int hashedHostAddress() { |
233 |
< |
try { |
234 |
< |
return InetAddress.getLocalHost().hashCode(); |
235 |
< |
} catch (Exception ex) { |
236 |
< |
return 0; |
237 |
< |
} |
233 |
> |
try { |
234 |
> |
return InetAddress.getLocalHost().hashCode(); |
235 |
> |
} catch (Exception ex) { |
236 |
> |
return 0; |
237 |
> |
} |
238 |
|
} |
239 |
|
|
240 |
|
// IllegalArgumentException messages |
410 |
|
* positive. |
411 |
|
* @return a pseudorandom {@code int} value between zero |
412 |
|
* (inclusive) and the bound (exclusive) |
413 |
< |
* @throws IllegalArgumentException if the bound is less than zero |
413 |
> |
* @throws IllegalArgumentException if {@code bound} is not positive |
414 |
|
*/ |
415 |
|
public int nextInt(int bound) { |
416 |
|
if (bound <= 0) |
463 |
|
* positive. |
464 |
|
* @return a pseudorandom {@code long} value between zero |
465 |
|
* (inclusive) and the bound (exclusive) |
466 |
< |
* @throws IllegalArgumentException if {@code bound} is less than zero |
466 |
> |
* @throws IllegalArgumentException if {@code bound} is not positive |
467 |
|
*/ |
468 |
|
public long nextLong(long bound) { |
469 |
|
if (bound <= 0) |
518 |
|
* positive. |
519 |
|
* @return a pseudorandom {@code double} value between zero |
520 |
|
* (inclusive) and the bound (exclusive) |
521 |
< |
* @throws IllegalArgumentException if {@code bound} is less than zero |
521 |
> |
* @throws IllegalArgumentException if {@code bound} is not positive |
522 |
|
*/ |
523 |
|
public double nextDouble(double bound) { |
524 |
|
if (!(bound > 0.0)) |
558 |
|
// maintenance purposes the small differences across forms. |
559 |
|
|
560 |
|
/** |
561 |
< |
* Returns a stream producing the given {@code streamSize} number of |
562 |
< |
* pseudorandom {@code int} values. |
561 |
> |
* Returns a stream producing the given {@code streamSize} number |
562 |
> |
* of pseudorandom {@code int} values from this generator and/or |
563 |
> |
* one split from it. |
564 |
|
* |
565 |
|
* @param streamSize the number of values to generate |
566 |
|
* @return a stream of pseudorandom {@code int} values |
578 |
|
|
579 |
|
/** |
580 |
|
* Returns an effectively unlimited stream of pseudorandom {@code int} |
581 |
< |
* values. |
581 |
> |
* values from this generator and/or one split from it. |
582 |
|
* |
583 |
|
* @implNote This method is implemented to be equivalent to {@code |
584 |
|
* ints(Long.MAX_VALUE)}. |
593 |
|
} |
594 |
|
|
595 |
|
/** |
596 |
< |
* Returns a stream producing the given {@code streamSize} number of |
597 |
< |
* pseudorandom {@code int} values, each conforming to the given |
598 |
< |
* origin and bound. |
596 |
> |
* Returns a stream producing the given {@code streamSize} number |
597 |
> |
* of pseudorandom {@code int} values, each conforming to the |
598 |
> |
* given origin and bound. |
599 |
|
* |
600 |
|
* @param streamSize the number of values to generate |
601 |
|
* @param randomNumberOrigin the origin of each random value |
642 |
|
} |
643 |
|
|
644 |
|
/** |
645 |
< |
* Returns a stream producing the given {@code streamSize} number of |
646 |
< |
* pseudorandom {@code long} values. |
645 |
> |
* Returns a stream producing the given {@code streamSize} number |
646 |
> |
* of pseudorandom {@code long} values from this generator and/or |
647 |
> |
* one split from it. |
648 |
|
* |
649 |
|
* @param streamSize the number of values to generate |
650 |
|
* @return a stream of pseudorandom {@code long} values |
661 |
|
} |
662 |
|
|
663 |
|
/** |
664 |
< |
* Returns an effectively unlimited stream of pseudorandom {@code long} |
665 |
< |
* values. |
664 |
> |
* Returns an effectively unlimited stream of pseudorandom {@code |
665 |
> |
* long} values from this generator and/or one split from it. |
666 |
|
* |
667 |
|
* @implNote This method is implemented to be equivalent to {@code |
668 |
|
* longs(Long.MAX_VALUE)}. |