Random

trait Random[-T]

A transactional pseudo-random number generator which behaves numerically like java.util.Random.

Companion
object
class Object
trait Matchable
class Any
class BaseImpl[Tx]
class SysLike[Tx]

Value members

Abstract methods

def nextBoolean()(implicit tx: T): Boolean

Generates a random Boolean value.

Generates a random Boolean value.

def nextDouble()(implicit tx: T): Double

Generates a random Double value, uniformly distributed between 0.0 (inclusive) and 1.0 (exclusive).

Generates a random Double value, uniformly distributed between 0.0 (inclusive) and 1.0 (exclusive).

def nextFloat()(implicit tx: T): Float

Generates a random Float value, uniformly distributed between 0.0f (inclusive) and 1.0f (exclusive).

Generates a random Float value, uniformly distributed between 0.0f (inclusive) and 1.0f (exclusive).

def nextInt()(implicit tx: T): Int

Generates a random Int value in the range Int.MinValue to Int.MaxValue.

Generates a random Int value in the range Int.MinValue to Int.MaxValue.

def nextInt(n: Int)(implicit tx: T): Int

Generates a random Int value in the range of 0 (inclusive) until the specified value n (exclusive).

Generates a random Int value in the range of 0 (inclusive) until the specified value n (exclusive).

def nextLong()(implicit tx: T): Long

Generates a random Long value in the range Long.MinValue to Long.MaxValue.

Generates a random Long value in the range Long.MinValue to Long.MaxValue.

WARNING: Because it uses the same algorithm as java.util.Random, with a seed of only 48 bits, this function will not return all possible long values!

def rawSeed(implicit tx: T): Long
def rawSeed_=(seed: Long)(implicit tx: T): Unit

Resets the internal seed value to the given argument. This is a raw seed value as obtained from getRawSeed. For user operation, use setSeed instead, which further scrambles the seed value.

Resets the internal seed value to the given argument. This is a raw seed value as obtained from getRawSeed. For user operation, use setSeed instead, which further scrambles the seed value.

def setSeed(seed: Long)(implicit tx: T): Unit

Resets the internal seed value to the given argument.

Resets the internal seed value to the given argument.