Class RandomFactory


  • public class RandomFactory
    extends Object
    • Constructor Detail

      • RandomFactory

        public RandomFactory​(Class randomClass)
    • Method Detail

      • getRandom

        public Random getRandom()
        This method returns Random implementation instance associated with calling thread
        Returns:
        object implementing Random interface
      • getNewRandomInstance

        public Random getNewRandomInstance()
        This method returns new onject implementing Random interface, initialized with System.currentTimeMillis() as seed
        Returns:
        object implementing Random interface
      • getNewRandomInstance

        public Random getNewRandomInstance​(long seed)
        This method returns new onject implementing Random interface, initialized with seed value
        Parameters:
        seed - seed for this rng object
        Returns:
        object implementing Random interface
      • getNewRandomInstance

        public Random getNewRandomInstance​(long seed,
                                           long size)
        This method returns a new object implementing Random interface, initialized with seed value, with size of elements in buffer
        Parameters:
        seed - rng seed
        size - size of underlying buffer
        Returns:
        object implementing Random interface