Class ProviderBuilder
- java.lang.Object
-
- org.apache.commons.rng.simple.internal.ProviderBuilder
-
public final class ProviderBuilder extends 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 classProviderBuilder.RandomSourceInternalIdentifiers of the generators.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RestorableUniformRandomProvidercreate(ProviderBuilder.RandomSourceInternal source)Creates a RNG instance.static RestorableUniformRandomProvidercreate(ProviderBuilder.RandomSourceInternal source, Object seed, Object[] args)Creates a RNG instance.
-
-
-
Method Detail
-
create
public static RestorableUniformRandomProvider create(ProviderBuilder.RandomSourceInternal source)
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.
-
-