Class ProviderBuilder
java.lang.Object
org.apache.commons.rng.simple.internal.ProviderBuilder
RNG builder.
It uses reflection to find the factory method of the RNG implementation, and performs seed type conversions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIdentifiers of the generators. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a RNG instance.create(ProviderBuilder.RandomSourceInternal source, Object seed, Object[] args) Creates a RNG instance.
-
Field Details
-
INTERNAL_ERROR_MSG
Error message.- See Also:
-
-
Constructor Details
-
ProviderBuilder
private ProviderBuilder()Class only contains static method.
-
-
Method Details
-
create
Creates a RNG instance.- Parameters:
source- RNG specification.- Returns:
- a new RNG instance.
- Throws:
IllegalArgumentException- if argument data to initialize the generator implemented by the givensourceis missing.- Since:
- 1.3
-
create
public static RestorableUniformRandomProvider create(ProviderBuilder.RandomSourceInternal source, Object seed, Object[] args) Creates a RNG instance.- Parameters:
source- RNG specification.seed- Seed value. It can benull(in which case a random value will be used).args- Additional arguments to the implementation's constructor.- Returns:
- a new RNG instance.
- Throws:
UnsupportedOperationException- if the seed type is invalid.IllegalArgumentException- if argument data to initialize the generator implemented by the givensourceis invalid.
-