scala

class Random

[source: scala/Random.scala]

class Random(val self : Random)
extends AnyRef
Author
Stephane Micheloud
Additional Constructor Summary
def this (seed : Int) : Random
Creates a new random number generator using a single integer seed.
def this (seed : Long) : Random
Creates a new random number generator using a single long seed.
def this : Random
Creates a new random number generator.
Method Summary
def nextBoolean : Boolean
Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.
def nextBytes (bytes : Array[Byte]) : Unit
Generates random bytes and places them into a user-supplied byte array.
def nextDouble : Double
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.
def nextFloat : Float
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.
def nextInt (n : Int) : Int
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
def nextInt : Int
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
def nextLong : Long
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
def setSeed (seed : Long) : Unit
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Additional Constructor Details
def this(seed : Long) : Random
Creates a new random number generator using a single long seed.

def this(seed : Int) : Random
Creates a new random number generator using a single integer seed.

def this : Random
Creates a new random number generator.

Method Details
def nextBoolean : Boolean
Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.

def nextBytes(bytes : Array[Byte]) : Unit
Generates random bytes and places them into a user-supplied byte array.

def nextDouble : Double
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.

def nextFloat : Float
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.

def nextInt : Int
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.

def nextInt(n : Int) : Int
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

def nextLong : Long
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.

def setSeed(seed : Long) : Unit