In Constructors

In Fields

Returned by

As method parameter

Library: | Apache Jakarta Commons Math 1.1 |

Package: | org.apache.commons.math.random |

Class

Overview

Inheritance

Members

Usage

Source

Books

`nextSecureXxx`

methods. If no`RandomGenerator`

is provided in the constructor, the default is to use a generator based on Random . To plug in a different implementation, either implement`RandomGenerator`

directly or extend AbstractRandomGenerator .Supports reseeding the underlying pseudo-random number generator (PRNG). The

`SecurityProvider`

and`Algorithm`

used by the`SecureRandom`

instance can also be reset.For details on the default PRNGs, see Random and SecureRandom .

Usage Notes:`RandomGenerator`

and`SecureRandom`

instances used in data generation. Therefore, to generate a random sequence of values or strings, you should use justone`RandomDataImpl`

instance repeatedly.`RandomDataImpl`

is created, the underlying random number generators arenotintialized. If you do not explicitly seed the default non-secure generator, it is seeded with the current time in milliseconds on first use. The same holds for the secure generator. If you provide a`RandomGenerator`

to the constructor, however, this generator is not reseeded by the constructor nor is it reseeded on first use.`reSeed`

and`reSeedSecure`

methods delegate to the corresponding methods on the underlying`RandomGenerator`

and`SecureRandom`

instances. Therefore,`reSeed(long)`

fully resets the initial state of the non-secure random number generator (so that reseeding with a specific value always results in the same subsequent random sequence); whereas reSeedSecure(long) doesnotreinitialize the secure random number generator (so secure sequences started with calls to reseedSecure(long) won't be identical).