Top Description Fields Constructors Methods
org.apache.commons.math3.random

public Class JDKRandomGenerator

extends Random
implements RandomGenerator
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.random.RandomGenerator
Imports
java.util.Random

Extension of java.util.Random to implement RandomGenerator.
Since
1.1

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Hides java.util.Random.serialVersionUID.

Serializable version identifier.

Constructor Summary

AccessConstructor and Description
public
JDKRandomGenerator()

Create a new JDKRandomGenerator with a default seed.

public
JDKRandomGenerator(int
initial seed
seed
)

Create a new JDKRandomGenerator with the given seed.

Method Summary

Modifier and TypeMethod and Description
public void
setSeed(int
the seed value
seed
)

Implements org.apache.commons.math3.random.RandomGenerator.setSeed.

Sets the seed of the underlying random number generator using an int seed.

public void
setSeed(int[]
the seed value
seed
)

Implements org.apache.commons.math3.random.RandomGenerator.setSeed.

Sets the seed of the underlying random number generator using an int array seed.

Inherited from java.util.Random:
doublesdoublesdoublesdoublesfromintsintsintsintslongslongslongslongsnextnextBooleannextBytesnextDoublenextFloatnextGaussiannextIntnextIntnextLongsetSeed

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.Random.serialVersionUID.

Serializable version identifier.

Constructor Detail

JDKRandomGeneratorback to summary
public JDKRandomGenerator()

Create a new JDKRandomGenerator with a default seed.

JDKRandomGeneratorback to summary
public JDKRandomGenerator(int seed)

Create a new JDKRandomGenerator with the given seed.

Parameters
seed:int

initial seed

Since
3.6

Method Detail

setSeedback to summary
public void setSeed(int seed)

Implements org.apache.commons.math3.random.RandomGenerator.setSeed.

Doc from org.apache.commons.math3.random.RandomGenerator.setSeed.

Sets the seed of the underlying random number generator using an int seed.

Sequences of values generated starting with the same seeds should be identical.

Parameters
seed:int

the seed value

setSeedback to summary
public void setSeed(int[] seed)

Implements org.apache.commons.math3.random.RandomGenerator.setSeed.

Doc from org.apache.commons.math3.random.RandomGenerator.setSeed.

Sets the seed of the underlying random number generator using an int array seed.

Sequences of values generated starting with the same seeds should be identical.

Parameters
seed:int[]

the seed value