Module java.base
Package java.util.random

Class RandomGeneratorFactory<T extends RandomGenerator>

java.lang.Object
java.util.random.RandomGeneratorFactory<T>

                                                        public class RandomGeneratorFactory<T extends RandomGenerator>
extends Object
                        
                        
This is a factory class for generating random number generators of a specific category and algorithm.
Since:
16
  • Method Summary

    Modifier and Type
    Method
    Description
    T
    create()
    Create an instance of RandomGenerator based on algorithm chosen.
    T
    create​(byte[] seed)
    Create an instance of RandomGenerator based on algorithm chosen providing a starting byte[] seed.
    T
    create​(long seed)
    Create an instance of RandomGenerator based on algorithm chosen providing a starting long seed.
    int
    Returns the equidistribution of the algorithm.
    group()
    Return the group name of the algorithm used by the random number generator.
    boolean
    Return true if random generator is arbitrarily jumpable.
    boolean
    Return true if random generator is generated by hardware.
    boolean
    Return true if random generator is jumpable.
    boolean
    Return true if random generator is leapable.
    boolean
    Return true if random generator is splittable.
    boolean
    Return true if random generator is statistical.
    boolean
    Return true if random generator is stochastic.
    boolean
    Return true if random generator is streamable.
    name()
    Return the name of the algorithm used by the random number generator.
    period()
    Return the period of the algorithm used by the random number generator.
    int
    Returns number of bits used to maintain state of seed.

    Methods declared in class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • name

      public String name()
      Return the name of the algorithm used by the random number generator.
      Returns:
      Name of the algorithm.

    • group

      public String group()
      Return the group name of the algorithm used by the random number generator.
      Returns:
      Group name of the algorithm.

    • stateBits

      public int stateBits()
      Returns number of bits used to maintain state of seed.
      Returns:
      number of bits used to maintain state of seed.

    • equidistribution

      public int equidistribution()
      Returns the equidistribution of the algorithm.
      Returns:
      the equidistribution of the algorithm.

    • period

      public BigInteger period()
      Return the period of the algorithm used by the random number generator.
      Returns:
      BigInteger period.

    • isStatistical

      public boolean isStatistical()
      Return true if random generator is statistical.
      Returns:
      true if random generator is statistical.

    • isStochastic

      public boolean isStochastic()
      Return true if random generator is stochastic.
      Returns:
      true if random generator is stochastic.

    • isHardware

      public boolean isHardware()
      Return true if random generator is generated by hardware.
      Returns:
      true if random generator is generated by hardware.

    • isArbitrarilyJumpable

      public boolean isArbitrarilyJumpable()
      Return true if random generator is arbitrarily jumpable.
      Returns:
      true if random generator is arbitrarily jumpable.

    • isJumpable

      public boolean isJumpable()
      Return true if random generator is jumpable.
      Returns:
      true if random generator is jumpable.

    • isLeapable

      public boolean isLeapable()
      Return true if random generator is leapable.
      Returns:
      true if random generator is leapable.

    • isSplittable

      public boolean isSplittable()
      Return true if random generator is splittable.
      Returns:
      true if random generator is splittable.

    • isStreamable

      public boolean isStreamable()
      Return true if random generator is streamable.
      Returns:
      true if random generator is streamable.

    • create

      public T create()
      Create an instance of RandomGenerator based on algorithm chosen.
      Returns:
      new in instance of RandomGenerator.

    • create

      public T create(long seed)
      Create an instance of RandomGenerator based on algorithm chosen providing a starting long seed. If long seed is not supported by an algorithm then the no argument form of create is used.
      Parameters:
      seed - long random seed value.
      Returns:
      new in instance of RandomGenerator.

    • create

      public T create(byte[] seed)
      Create an instance of RandomGenerator based on algorithm chosen providing a starting byte[] seed. If byte[] seed is not supported by an algorithm then the no argument form of create is used.
      Parameters:
      seed - byte array random seed value.
      Returns:
      new in instance of RandomGenerator.