Packages

class Random extends Serializable

Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Random
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def between(minInclusive: Double, maxExclusive: Double): Double

    Generate a uniformly random Double in a given interval.

    Generate a uniformly random Double in a given interval.

    minInclusive

    inclusive minimum of the interval

    maxExclusive

    exclusive maximum of the interval

    returns

    uniformly random Double between minInclusive and maxExclusive

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

    Generate a uniformly random Int in a given interval.

    Generate a uniformly random Int in a given interval.

    minInclusive

    inclusive minimum of the interval

    maxExclusive

    exclusive maximum of the interval

    returns

    uniformly random Int between minInclusive and maxExclusive

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

    Generate a uniformly random Long in a given interval.

    Generate a uniformly random Long in a given interval.

    minInclusive

    inclusive minimum of the interval

    maxExclusive

    exclusive maximum of the interval

    returns

    uniformly random Long between minInclusive and maxExclusive

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def nextBoolean(): Boolean

    Generate a uniformly random Boolean.

    Generate a uniformly random Boolean.

    returns

    a random Boolean

  16. def nextDouble(): Double

    Generate a uniformly random Double between zero (inclusive) and one (exclusive).

    Generate a uniformly random Double between zero (inclusive) and one (exclusive).

    returns

    a uniformly random number on the unit interval

  17. def nextGaussian(mean: Double, stdDev: Double): Double

    Generate a Gaussian-distributed random variable with given mean and standard deviation.

    Generate a Gaussian-distributed random variable with given mean and standard deviation.

    mean

    of the distribution

    stdDev

    of the distribution

  18. def nextGaussian(): Double

    Generate a Gaussian-distributed random Double with mean 0 and variance 1

    Generate a Gaussian-distributed random Double with mean 0 and variance 1

    returns

    a draw from the standard normal distribution.

  19. def nextInt(bound: Int): Int

    Generate a uniformly random Int between zero and a given exclusive upper bound.

    Generate a uniformly random Int between zero and a given exclusive upper bound.

    bound

    exclusive upper bound

    returns

    a random Int between 0 (inclusive) and bound (exclusive)

  20. def nextInt(): Int

    Generate a uniformly random Int on the whole allowed range.

    Generate a uniformly random Int on the whole allowed range.

    returns

    a random Int

  21. def nextLong(bound: Long): Long

    Generate a uniformly random Long between zero and a given exclusive upper bound.

    Generate a uniformly random Long between zero and a given exclusive upper bound.

    bound

    exclusive upper bound

    returns

    a random Long between 0 (inclusive) and bound (exclusive)

  22. def nextLong(): Long

    Generate a uniformly random Long on the whole allowed range.

    Generate a uniformly random Long on the whole allowed range.

    returns

    a random Long

  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. def shuffle[T, CC[X] <: IterableOnce[X]](xs: CC[T])(implicit bf: BuildFrom[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.

    Taken from scala.util.Random

    T

    the type of elements in xs

    CC

    the type of collection

    xs

    the values to shuffle

    bf

    builder for type CC[T] from type CC[T]

    returns

    a collection of type CC[T] with elements uniformly shuffled

  26. def split(): Random

    Split off an independent parallel stream of random numbers.

    Split off an independent parallel stream of random numbers.

    returns

    a new instance of Random whose stream of random numbers are independent of the present stream.

  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. def zip[T, CC[X] <: IterableOnce[X]](xs: CC[T])(implicit bf: BuildFrom[CC[T], (Random, T), CC[(Random, T)]]): CC[(Random, T)]

    Zip the rng with the iterable collection, splitting the rng on each new element.

    Zip the rng with the iterable collection, splitting the rng on each new element.

    This method is useful for producing a stream of independent random generators for multi-threaded applications.

    T

    the type of elements in xs

    CC

    the type of collection

    xs

    the collection to zip with

    bf

    builder for type CC[(Random, T)] from type CC[T]

    returns

    a collection of type CC[(Random, T)] with elements zipped with split random generators

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped