Package jline.util

Class ThreadLocalRandom

  • All Implemented Interfaces:

    public class ThreadLocalRandom
    
                        

    A class for random number generation in separate threads. This class now delegates to RandomManager for centralized, reproducible random number generation.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static double random() Generates a random double value in [0.0, 1.0) using the thread-specific MersenneTwister.
      static void setSeed(int seed) Sets the seed for the current thread's random number generator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThreadLocalRandom

        ThreadLocalRandom()
    • Method Detail

      • random

         static double random()

        Generates a random double value in [0.0, 1.0) using the thread-specific MersenneTwister.

        Returns:

        random double value

      • setSeed

         static void setSeed(int seed)

        Sets the seed for the current thread's random number generator. For backward compatibility, this only affects the current thread.

        Parameters:
        seed - the seed value