public class DRand extends RandomEngine
The seed can be any integer satisfying 0 < 4*seed+1 < 232. In other words, there must hold seed >= 0 && seed < 1073741823.
Quality: This generator follows the multiplicative congruential method of the form
Note that this implementation is not synchronized.
Random, Serialized Form
|Modifier and Type||Field and Description|
|Constructor and Description|
Constructs and returns a random number generator with a default seed, which is a constant.
Constructs and returns a random number generator seeded with the given date.
Constructs and returns a random number generator with the given seed.
|Modifier and Type||Method and Description|
Returns a 32 bit uniformly distributed random number in the closed interval [Integer.MIN_VALUE,Integer.MAX_VALUE] (including Integer.MIN_VALUE and Integer.MAX_VALUE).
Sets the receiver's seed.
apply, apply, makeDefault, nextDouble, nextFloat, nextLong, raw
public static final int DEFAULT_SEED
public DRand(int seed)
seed- should not be 0, in such a case DRand.DEFAULT_SEED is substituted.
public DRand(Date d)
d- typically new java.util.Date()
public int nextInt()
protected void setSeed(int seed)
seed- if the above condition does not hold, a modified seed that meets the condition is silently substituted.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.