Class/Object

scala.util

Random

Related Docs: object Random | package util

Permalink

class Random extends Serializable

Linear Supertypes
Serializable, java.io.Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Random
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Random()

    Permalink

    Creates a new random number generator.

  2. new Random(seed: Int)

    Permalink

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

  3. new Random(seed: Long)

    Permalink

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

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

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def alphanumeric: collection.immutable.Stream[Char]

    Permalink

    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.

    Since

    2.8

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def nextBoolean(): Boolean

    Permalink

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

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

    Permalink

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

  16. def nextDouble(): Double

    Permalink

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

  17. def nextFloat(): Float

    Permalink

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

  18. def nextGaussian(): Double

    Permalink

    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.

  19. def nextInt(n: Int): Int

    Permalink

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

  20. def nextInt(): Int

    Permalink

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

  21. def nextLong(): Long

    Permalink

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

  22. def nextPrintableChar(): Char

    Permalink

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

  23. def nextString(length: Int): String

    Permalink

    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

  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. val self: java.util.Random

    Permalink
  27. def setSeed(seed: Long): Unit

    Permalink
  28. def shuffle[T, CC[X] <: TraversableOnce[X]](xs: CC[T])(implicit bf: CanBuildFrom[CC[T], T, CC[T]]): CC[T]

    Permalink

    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

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. final def isAlphaNum$1(c: Char): Boolean

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.6) Preserved for backwards binary compatibility. To remove in 2.12.x.

Inherited from Serializable

Inherited from java.io.Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped