Packages

class Random extends Serializable

Source
Random.scala
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Random
  2. Serializable
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Random()

    Creates a new random number generator.

  2. new Random(seed: Int)

    Creates a new random number generator using a single integer seed.

  3. new Random(seed: Long)

    Creates a new random number generator using a single long seed.

  4. new Random(self: java.util.Random)

Value Members

  1. def alphanumeric: collection.immutable.LazyList[Char]

    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.

    Annotations
    @migration
    Migration

    (Changed in version 2.13.0) alphanumeric returns a LazyList instead of a Stream

  2. def between(minInclusive: Long, maxExclusive: Long): Long

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

  3. def between(minInclusive: Int, maxExclusive: Int): Int

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

  4. def between(minInclusive: Float, maxExclusive: Float): Float

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

  5. def between(minInclusive: Double, maxExclusive: Double): Double

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

  6. def nextBoolean(): Boolean

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

  7. def nextBytes(n: Int): Array[Byte]

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

  8. def nextBytes(bytes: Array[Byte]): Unit

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

  9. def nextDouble(): Double

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

  10. def nextFloat(): Float

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

  11. def nextGaussian(): Double

    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.

  12. 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.

  13. def nextInt(): Int

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

  14. 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.

  15. def nextLong(): Long

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

  16. def nextPrintableChar(): Char

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

  17. def nextString(length: Int): String

    Returns a pseudorandomly generated String.

    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.

    length

    the desired length of the String

    returns

    the String

  18. val self: java.util.Random
  19. def setSeed(seed: Long): Unit
  20. 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.

    returns

    the shuffled collection