Class 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.

    • Method Detail

      • create

        public static org.apache.commons.rng.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 given source is missing.
        Since:
        1.3
      • create

        public static org.apache.commons.rng.RestorableUniformRandomProvider create​(ProviderBuilder.RandomSourceInternal source,
                                                                                    Object seed,
                                                                                    Object[] args)
        Creates a RNG instance.
        Parameters:
        source - RNG specification.
        seed - Seed value. It can be null (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 given source is invalid.