SplittableRandom
    class SplittableRandom : RandomGenerator, RandomGenerator.SplittableGenerator
    
    A generator of uniform pseudorandom values (with period 264) applicable for use in (among other contexts) isolated parallel computations that may generate subtasks. Class SplittableRandom supports methods for producing pseudorandom numbers of type int, long, and double with similar usages as for class java.util.Random but differs in the following ways: 
      
 
        - Series of generated values pass the DieHarder suite testing independence and uniformity properties of random number generators. (Most recently validated with  version 3.31.1.) These tests validate only the methods for certain types and ranges, but similar properties are expected to hold, at least approximately, for others as well. The period (length of any series of generated values before it repeats) is 264. 
-  Method #split constructs and returns a new SplittableRandom instance that shares no mutable state with the current instance. However, with very high probability, the values collectively generated by the two objects have the same statistical properties as if the same quantity of values were generated by a single thread using a single SplittableRandomobject.
- Instances of SplittableRandom are not thread-safe. They are designed to be split, not shared, across threads. For example, a  fork/join-stylecomputation using random numbers might include a construction of the formnew Subtask(aSplittableRandom.split()).fork().
- This class provides additional methods for generating random streams, that employ the above techniques when used in stream.parallel()mode.
Instances of SplittableRandom are not cryptographically secure. Consider instead using java.security.SecureRandom in security-sensitive applications. Additionally, default-constructed instances do not use a cryptographically random seed unless the java.lang.System#getProperty java.util.secureRandomSeed is set to true.
    Summary
    
      
        
          | Public constructors | 
        
          | Creates a new SplittableRandom instance that is likely to generate sequences of values that are statistically independent of those of any other instances in the current program; and may, and typically does, vary across program invocations. | 
        
          | Creates a new SplittableRandom instance using the specified initial seed. | 
      
    
    
      
        
          | Public methods | 
        
          | DoubleStream! | Returns an effectively unlimited stream of pseudorandom doublevalues from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive). | 
        
          | DoubleStream! | Returns an effectively unlimited stream of pseudorandom doublevalues from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive). | 
        
          | DoubleStream! | Returns a stream producing the given streamSizenumber of pseudorandomdoublevalues from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive). | 
        
          | DoubleStream! | Returns a stream producing the given streamSizenumber of pseudorandomdoublevalues from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive). | 
        
          | IntStream! | Returns an effectively unlimited stream of pseudorandom intvalues from this generator and/or one split from it. | 
        
          | IntStream! | ints(randomNumberOrigin: Int, randomNumberBound: Int)Returns an effectively unlimited stream of pseudorandom intvalues from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive). | 
        
          | IntStream! | Returns a stream producing the given streamSizenumber of pseudorandomintvalues from this generator and/or one split from it. | 
        
          | IntStream! | ints(streamSize: Long, randomNumberOrigin: Int, randomNumberBound: Int)Returns a stream producing the given streamSizenumber of pseudorandomintvalues from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive). | 
        
          | LongStream! | Returns an effectively unlimited stream of pseudorandom longvalues from this generator and/or one split from it. | 
        
          | LongStream! | Returns a stream producing the given streamSizenumber of pseudorandomlongvalues from this generator and/or one split from it. | 
        
          | LongStream! | Returns an effectively unlimited stream of pseudorandom longvalues from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive). | 
        
          | LongStream! | Returns a stream producing the given streamSizenumber of pseudorandomlongvalues from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive). | 
        
          | Unit | Fills a user-supplied byte array with generated byte values pseudorandomly chosen uniformly from the range of values between -128 (inclusive) and 127 (inclusive). | 
        
          | Int |  | 
        
          | Long |  | 
        
          | SplittableRandom! | Constructs and returns a new SplittableRandom instance that shares no mutable state with this instance. | 
        
          | SplittableRandom! | Returns a new pseudorandom number generator, split off from this one, that implements the RandomGeneratorandSplittableGeneratorinterfaces. | 
        
          | Stream<RandomGenerator.SplittableGenerator!>! | Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the SplittableGeneratorinterface. | 
        
          | Stream<RandomGenerator.SplittableGenerator!>! | Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the SplittableGeneratorinterface. | 
        
          | Stream<RandomGenerator.SplittableGenerator!>! | Returns a stream producing the given streamSizenumber of new pseudorandom number generators, each of which implements theSplittableGeneratorinterface. | 
        
          | Stream<RandomGenerator.SplittableGenerator!>! | Returns a stream producing the given streamSizenumber of new pseudorandom number generators, each of which implements theSplittableGeneratorinterface. | 
      
    
    
      
        
          | Inherited functions | 
        
          | From class RandomGenerator
                
                  
                    | Boolean | isDeprecated()
                         Return true if the implementation of RandomGenerator (algorithm) has been marked for deprecation. |  
                    | Boolean | nextBoolean()
                         Returns a pseudorandomly chosen booleanvalue.  The default implementation tests the high-order bit (sign bit) of a value produced by nextInt(), on the grounds that some algorithms for pseudorandom number generation produce values whose high-order bits have better statistical quality than the low-order bits. |  
                    | Double | nextDouble()
                         Returns a pseudorandom doublevalue between zero (inclusive) and one (exclusive). |  
                    | Double | nextDouble(bound: Double)
                         Returns a pseudorandomly chosen doublevalue between zero (inclusive) and the specified bound (exclusive). |  
                    | Double | nextDouble(origin: Double, bound: Double)
                         Returns a pseudorandomly chosen doublevalue between the specified origin (inclusive) and the specified bound (exclusive). |  
                    | Double | nextExponential()
                         Returns a nonnegative doublevalue pseudorandomly chosen from an exponential distribution whose mean is 1. |  
                    | Float | nextFloat()
                         Returns a pseudorandom floatvalue between zero (inclusive) and one (exclusive). |  
                    | Float | nextFloat(bound: Float)
                         Returns a pseudorandomly chosen floatvalue between zero (inclusive) and the specified bound (exclusive). |  
                    | Float | nextFloat(origin: Float, bound: Float)
                         Returns a pseudorandomly chosen floatvalue between the specified origin (inclusive) and the specified bound (exclusive). |  
                    | Double | nextGaussian()
                         Returns a doublevalue pseudorandomly chosen from a Gaussian (normal) distribution whose mean is 0 and whose standard deviation is 1. |  
                    | Double | nextGaussian(mean: Double, stddev: Double)
                         Returns a doublevalue pseudorandomly chosen from a Gaussian (normal) distribution with a mean and standard deviation specified by the arguments. |  
                    | Int | nextInt(bound: Int)
                         Returns a pseudorandomly chosen intvalue between zero (inclusive) and the specified bound (exclusive). |  
                    | Int | nextInt(origin: Int, bound: Int)
                         Returns a pseudorandomly chosen intvalue between the specified origin (inclusive) and the specified bound (exclusive). |  
                    | Long | nextLong(bound: Long)
                         Returns a pseudorandomly chosen longvalue between zero (inclusive) and the specified bound (exclusive). |  
                    | Long | nextLong(origin: Long, bound: Long)
                         Returns a pseudorandomly chosen longvalue between the specified origin (inclusive) and the specified bound (exclusive). |  | 
        
          | From class SplittableGenerator
                
                  
                    | Stream<RandomGenerator!>! | rngs()
                         Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the RandomGeneratorinterface. Ideally the generators in the stream will appear to be statistically independent. |  
                    | Stream<RandomGenerator!>! | rngs(streamSize: Long)
                         Returns a stream producing the given streamSizenumber of new pseudorandom number generators, each of which implements theRandomGeneratorinterface. Ideally the generators in the stream will appear to be statistically independent. |  | 
      
    
    Public constructors
    
      SplittableRandom
      
      SplittableRandom()
      Creates a new SplittableRandom instance that is likely to generate sequences of values that are statistically independent of those of any other instances in the current program; and may, and typically does, vary across program invocations.
     
    
      SplittableRandom
      
      SplittableRandom(seed: Long)
      Creates a new SplittableRandom instance using the specified initial seed. SplittableRandom instances created with the same seed in the same program generate identical sequences of values.
      
        
          
            | Parameters | 
          
            | seed | Long: the initial seed | 
        
      
     
    Public methods
    
      doubles
      
      fun doubles(): DoubleStream!
      Returns an effectively unlimited stream of pseudorandom double values from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive).
      
     
    
      doubles
      
      fun doubles(
    randomNumberOrigin: Double, 
    randomNumberBound: Double
): DoubleStream!
      Returns an effectively unlimited stream of pseudorandom double values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).
      
        
          
            | Parameters | 
          
            | randomNumberOrigin | Double: the origin (inclusive) of each random value | 
          
            | randomNumberBound | Double: the bound (exclusive) of each random value | 
        
      
      
        
          
            | Return | 
          
            | DoubleStream! | a stream of pseudorandom doublevalues, each with the given origin (inclusive) and bound (exclusive) | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if randomNumberOriginis greater than or equal torandomNumberBound | 
        
      
     
    
      doubles
      
      fun doubles(streamSize: Long): DoubleStream!
      Returns a stream producing the given streamSize number of pseudorandom double values from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive).
      
        
          
            | Parameters | 
          
            | streamSize | Long: the number of values to generate | 
        
      
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if streamSizeis less than zero | 
        
      
     
    
      doubles
      
      fun doubles(
    streamSize: Long, 
    randomNumberOrigin: Double, 
    randomNumberBound: Double
): DoubleStream!
      Returns a stream producing the given streamSize number of pseudorandom double values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).
      
        
          
            | Parameters | 
          
            | streamSize | Long: the number of values to generate | 
          
            | randomNumberOrigin | Double: the origin (inclusive) of each random value | 
          
            | randomNumberBound | Double: the bound (exclusive) of each random value | 
        
      
      
        
          
            | Return | 
          
            | DoubleStream! | a stream of pseudorandom doublevalues, each with the given origin (inclusive) and bound (exclusive) | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if streamSizeis less than zero, orrandomNumberOriginis greater than or equal torandomNumberBound | 
        
      
     
    
      ints
      
      fun ints(): IntStream!
      Returns an effectively unlimited stream of pseudorandom int values from this generator and/or one split from it.
      
        
          
            | Return | 
          
            | IntStream! | a stream of pseudorandom intvalues | 
        
      
     
    
      ints
      
      fun ints(
    randomNumberOrigin: Int, 
    randomNumberBound: Int
): IntStream!
      Returns an effectively unlimited stream of pseudorandom int values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).
      
        
          
            | Parameters | 
          
            | randomNumberOrigin | Int: the origin (inclusive) of each random value | 
          
            | randomNumberBound | Int: the bound (exclusive) of each random value | 
        
      
      
        
          
            | Return | 
          
            | IntStream! | a stream of pseudorandom intvalues, each with the given origin (inclusive) and bound (exclusive) | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if randomNumberOriginis greater than or equal torandomNumberBound | 
        
      
     
    
      ints
      
      fun ints(streamSize: Long): IntStream!
      Returns a stream producing the given streamSize number of pseudorandom int values from this generator and/or one split from it.
      
        
          
            | Parameters | 
          
            | streamSize | Long: the number of values to generate | 
        
      
      
        
          
            | Return | 
          
            | IntStream! | a stream of pseudorandom intvalues | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if streamSizeis less than zero | 
        
      
     
    
      ints
      
      fun ints(
    streamSize: Long, 
    randomNumberOrigin: Int, 
    randomNumberBound: Int
): IntStream!
      Returns a stream producing the given streamSize number of pseudorandom int values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).
      
        
          
            | Parameters | 
          
            | streamSize | Long: the number of values to generate | 
          
            | randomNumberOrigin | Int: the origin (inclusive) of each random value | 
          
            | randomNumberBound | Int: the bound (exclusive) of each random value | 
        
      
      
        
          
            | Return | 
          
            | IntStream! | a stream of pseudorandom intvalues, each with the given origin (inclusive) and bound (exclusive) | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if streamSizeis less than zero, orrandomNumberOriginis greater than or equal torandomNumberBound | 
        
      
     
    
      longs
      
      fun longs(): LongStream!
      Returns an effectively unlimited stream of pseudorandom long values from this generator and/or one split from it.
      
        
          
            | Return | 
          
            | LongStream! | a stream of pseudorandom longvalues | 
        
      
     
    
      longs
      
      fun longs(streamSize: Long): LongStream!
      Returns a stream producing the given streamSize number of pseudorandom long values from this generator and/or one split from it.
      
        
          
            | Parameters | 
          
            | streamSize | Long: the number of values to generate | 
        
      
      
        
          
            | Return | 
          
            | LongStream! | a stream of pseudorandom longvalues | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if streamSizeis less than zero | 
        
      
     
    
      longs
      
      fun longs(
    randomNumberOrigin: Long, 
    randomNumberBound: Long
): LongStream!
      Returns an effectively unlimited stream of pseudorandom long values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).
      
        
          
            | Parameters | 
          
            | randomNumberOrigin | Long: the origin (inclusive) of each random value | 
          
            | randomNumberBound | Long: the bound (exclusive) of each random value | 
        
      
      
        
          
            | Return | 
          
            | LongStream! | a stream of pseudorandom longvalues, each with the given origin (inclusive) and bound (exclusive) | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if randomNumberOriginis greater than or equal torandomNumberBound | 
        
      
     
    
      longs
      
      fun longs(
    streamSize: Long, 
    randomNumberOrigin: Long, 
    randomNumberBound: Long
): LongStream!
      Returns a stream producing the given streamSize number of pseudorandom long values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).
      
        
          
            | Parameters | 
          
            | streamSize | Long: the number of values to generate | 
          
            | randomNumberOrigin | Long: the origin (inclusive) of each random value | 
          
            | randomNumberBound | Long: the bound (exclusive) of each random value | 
        
      
      
        
          
            | Return | 
          
            | LongStream! | a stream of pseudorandom longvalues, each with the given origin (inclusive) and bound (exclusive) | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if streamSizeis less than zero, orrandomNumberOriginis greater than or equal torandomNumberBound | 
        
      
     
    
      nextBytes
      
      fun nextBytes(bytes: ByteArray!): Unit
      Fills a user-supplied byte array with generated byte values pseudorandomly chosen uniformly from the range of values between -128 (inclusive) and 127 (inclusive).
      
        
          
            | Parameters | 
          
            | bytes | ByteArray!: the byte array to fill with pseudorandom bytes | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.NullPointerException | if bytes is null | 
        
      
     
    
      nextInt
      
      fun nextInt(): Int
      
        
          
            | Return | 
          
            | Int | a pseudorandomly chosen intvalue | 
        
      
     
    
      nextLong
      
      fun nextLong(): Long
      
        
          
            | Return | 
          
            | Long | a pseudorandomly chosen longvalue | 
        
      
     
    
      split
      
      fun split(): SplittableRandom!
      Constructs and returns a new SplittableRandom instance that shares no mutable state with this instance. However, with very high probability, the set of values collectively generated by the two objects has the same statistical properties as if the same quantity of values were generated by a single thread using a single SplittableRandom object. Either or both of the two objects may be further split using the split() method, and the same expected statistical properties apply to the entire set of generators constructed by such recursive splitting.
      
     
    
    
      splits
      
      fun splits(): Stream<RandomGenerator.SplittableGenerator!>!
      Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the SplittableGenerator interface. 
       This pseudorandom number generator may be used as a source of pseudorandom bits used to initialize the state the new ones.
      
     
    
    
      splits
      
      fun splits(streamSize: Long): Stream<RandomGenerator.SplittableGenerator!>!
      Returns a stream producing the given streamSize number of new pseudorandom number generators, each of which implements the SplittableGenerator interface. 
       This pseudorandom number generator may be used as a source of pseudorandom bits used to initialize the state the new ones.
      
        
          
            | Parameters | 
          
            | streamSize | Long: the number of values to generate | 
        
      
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if streamSizeis less than zero |