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

    • Field Detail

      • INTERNAL_ERROR_MSG

        private static final java.lang.String INTERNAL_ERROR_MSG
        Error message.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProviderBuilder

        private ProviderBuilder()
        Class only contains static method.
    • 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 given source 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 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:
        java.lang.UnsupportedOperationException - if the seed type is invalid.
        java.lang.IllegalArgumentException - if argument data to initialize the generator implemented by the given source is invalid.