scala.util

Random

object Random extends Random

The object Random offers a default implementation of scala.util.Random and random-related convenience methods.

Source
Random.scala
Since

2.8

Linear Supertypes
Random, Serializable, java.io.Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Random
  2. Random
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def alphanumeric: collection.immutable.Stream[Char]

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

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

    Definition Classes
    Random
    Since

    2.8

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. implicit def javaRandomToRandom(r: java.util.Random): Random

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def nextBoolean(): Boolean

    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.

    Definition Classes
    Random
  18. def nextBytes(bytes: Array[Byte]): Unit

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

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

    Definition Classes
    Random
  19. def nextDouble(): Double

    Returns the next pseudorandom, uniformly distributed double value between 0.

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

    Definition Classes
    Random
  20. def nextFloat(): Float

    Returns the next pseudorandom, uniformly distributed float value between 0.

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

    Definition Classes
    Random
  21. def nextGaussian(): Double

    Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.

    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.

    Definition Classes
    Random
  22. 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.

    Definition Classes
    Random
  23. 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.

    Definition Classes
    Random
  24. 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.

    Definition Classes
    Random
  25. def nextPrintableChar(): Char

    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.

    Definition Classes
    Random
  26. 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

    Definition Classes
    Random
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  29. val self: java.util.Random

    Definition Classes
    Random
  30. def setSeed(seed: Long): Unit

    Definition Classes
    Random
  31. def shuffle[T, CC[X] <: TraversableOnce[X]](xs: CC[T])(implicit bf: CanBuildFrom[CC[T], T, CC[T]]): CC[T]

    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

    Definition Classes
    Random
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    AnyRef → Any
  34. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  35. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  36. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Random

Inherited from Serializable

Inherited from java.io.Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped