FastRandom

tinyscalautils.util.FastRandom
See theFastRandom companion class
object FastRandom extends FastRandom

A thread-safe, unseeded fast random number generator.

The implementation relies on ThreadLocalRandom, which can be shared across threads without contention. Java's fancier generators are not used.

This generator cannot be re-seeded (the setSeed method throws UnsupportedOperationException).

Attributes

Companion
class
Source
FastRandom.scala
Graph
Supertypes
class FastRandom
class Random
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
FastRandom.type

Members list

Value members

Inherited methods

Returns a LazyList of pseudorandomly chosen alphanumeric characters, equally chosen from A-Z, a-z, and 0-9.

Returns a LazyList of pseudorandomly chosen alphanumeric characters, equally chosen from A-Z, a-z, and 0-9.

Attributes

Inherited from:
Random
Source
Random.scala

Returns a pseudorandom, uniformly distributed long value between min (inclusive) and the specified value max (exclusive), drawn from this random number generator's sequence.

Returns a pseudorandom, uniformly distributed long value between min (inclusive) and the specified value max (exclusive), drawn from this random number generator's sequence.

Value parameters

maxExclusive

the upper bound (exclusive) of the range, must be greater than minInclusive

minInclusive

the lower bound (inclusive) of the range

Attributes

Inherited from:
Random
Source
Random.scala

Returns a pseudorandom, uniformly distributed int value between min (inclusive) and the specified value max (exclusive), drawn from this random number generator's sequence.

Returns a pseudorandom, uniformly distributed int value between min (inclusive) and the specified value max (exclusive), drawn from this random number generator's sequence.

Value parameters

maxExclusive

the upper bound (exclusive) of the range, must be greater than minInclusive

minInclusive

the lower bound (inclusive) of the range

Attributes

Inherited from:
Random
Source
Random.scala

Returns the next pseudorandom, uniformly distributed float value between min (inclusive) and max (exclusive) from this random number generator's sequence.

Returns the next pseudorandom, uniformly distributed float value between min (inclusive) and max (exclusive) from this random number generator's sequence.

Value parameters

maxExclusive

the upper bound (exclusive) of the range, must be greater than minInclusive

minInclusive

the lower bound (inclusive) of the range

Attributes

Inherited from:
Random
Source
Random.scala

Returns the next pseudorandom, uniformly distributed double value between min (inclusive) and max (exclusive) from this random number generator's sequence.

Returns the next pseudorandom, uniformly distributed double value between min (inclusive) and max (exclusive) from this random number generator's sequence.

Value parameters

maxExclusive

the upper bound (exclusive) of the range, must be greater than minInclusive

minInclusive

the lower bound (inclusive) of the range

Attributes

Inherited from:
Random
Source
Random.scala

Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.

Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.

Attributes

Inherited from:
Random
Source
Random.scala

Generates n random bytes and returns them in a new array.

Generates n random bytes and returns them in a new array.

Value parameters

n

the number of random bytes to generate

Attributes

Inherited from:
Random
Source
Random.scala

Generates random bytes and places them into a user-supplied byte array.

Generates random bytes and places them into a user-supplied byte array.

Value parameters

bytes

the byte array to fill with random bytes

Attributes

Inherited from:
Random
Source
Random.scala

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

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

Attributes

Inherited from:
Random
Source
Random.scala
def nextFloat(): Float

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

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

Attributes

Inherited from:
Random
Source
Random.scala

Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.

Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.

Attributes

Inherited from:
Random
Source
Random.scala
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.

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

Value parameters

n

the exclusive upper bound for the returned value (0 is the inclusive lower bound), must be positive

Attributes

Inherited from:
Random
Source
Random.scala
def nextInt(): Int

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

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

Attributes

Inherited from:
Random
Source
Random.scala
def nextLong(n: Long): Long

Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

Value parameters

n

the exclusive upper bound for the returned value (0 is the inclusive lower bound), must be positive

Attributes

Inherited from:
Random
Source
Random.scala
def nextLong(): Long

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

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

Attributes

Inherited from:
Random
Source
Random.scala

Returns the next pseudorandom, uniformly distributed value from the ASCII range 33-126.

Returns the next pseudorandom, uniformly distributed value from the ASCII range 33-126.

Attributes

Inherited from:
Random
Source
Random.scala

Returns a pseudorandomly generated String. This routine does not take any measures to preserve the randomness of the distribution in the face of factors like unicode's variable-length encoding, so please don't use this for anything important. It's primarily intended for generating test data.

Returns a pseudorandomly generated String. This routine does not take any measures to preserve the randomness of the distribution in the face of factors like unicode's variable-length encoding, so please don't use this for anything important. It's primarily intended for generating test data.

Value parameters

length

the desired length of the String

Attributes

Returns

a randomly generated String of the specified length

Inherited from:
Random
Source
Random.scala

Attributes

Inherited from:
Random
Source
Random.scala
def shuffle[T, C](xs: IterableOnce[T])(implicit bf: BuildFrom[xs.type, T, C]): C

Returns a new collection of the same type in a randomly chosen order.

Returns a new collection of the same type in a randomly chosen order.

Type parameters

C

the type of the collection returned, determined by the implicit BuildFrom

T

the element type of the collection

Value parameters

bf

the implicit BuildFrom instance used to build the result collection

xs

the collection to shuffle

Attributes

Returns

the shuffled collection

Inherited from:
Random
Source
Random.scala

Concrete fields

lazy val interruptible: Random

Interruptible variant, same as the interruptible extension, but cached for performance.

Interruptible variant, same as the interruptible extension, but cached for performance.

Attributes

Source
FastRandom.scala

Inherited fields

val self: Random

Attributes

Inherited from:
Random
Source
Random.scala