Class ProviderBuilder
- java.lang.Object
-
- org.apache.commons.rng.simple.internal.ProviderBuilder
-
public final class ProviderBuilder extends java.lang.Object
RNG builder.It uses reflection to find the factory method of the RNG implementation, and performs seed type conversions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProviderBuilder.RandomSourceInternal
Identifiers of the generators.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
INTERNAL_ERROR_MSG
Error message.
-
Constructor Summary
Constructors Modifier Constructor Description private
ProviderBuilder()
Class only contains static method.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RestorableUniformRandomProvider
create(ProviderBuilder.RandomSourceInternal source)
Creates a RNG instance.static RestorableUniformRandomProvider
create(ProviderBuilder.RandomSourceInternal source, java.lang.Object seed, java.lang.Object[] args)
Creates a RNG instance.
-
-
-
Field Detail
-
INTERNAL_ERROR_MSG
private static final java.lang.String INTERNAL_ERROR_MSG
Error message.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static RestorableUniformRandomProvider create(ProviderBuilder.RandomSourceInternal source)
Creates a RNG instance.- Parameters:
source
- RNG specification.- Returns:
- a new RNG instance.
- Throws:
java.lang.IllegalArgumentException
- if argument data to initialize the generator implemented by the givensource
is missing.- Since:
- 1.3
-
create
public static RestorableUniformRandomProvider create(ProviderBuilder.RandomSourceInternal source, java.lang.Object seed, java.lang.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:
java.lang.UnsupportedOperationException
- if the seed type is invalid.java.lang.IllegalArgumentException
- if argument data to initialize the generator implemented by the givensource
is invalid.
-
-