trait Random[-T] extends AnyRef
A transactional pseudo-random number generator which
behaves numerically like java.util.Random
.
- Alphabetic
- By Inheritance
- Random
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def nextBoolean()(implicit tx: T): Boolean
Generates a random
Boolean
value. - abstract def nextDouble()(implicit tx: T): Double
Generates a random
Double
value, uniformly distributed between0.0
(inclusive) and1.0
(exclusive). - abstract def nextFloat()(implicit tx: T): Float
Generates a random
Float
value, uniformly distributed between0.0f
(inclusive) and1.0f
(exclusive). - abstract def nextInt(n: Int)(implicit tx: T): Int
Generates a random
Int
value in the range of 0 (inclusive) until the specified valuen
(exclusive). - abstract def nextInt()(implicit tx: T): Int
Generates a random
Int
value in the rangeInt.MinValue
toInt.MaxValue
. - abstract def nextLong()(implicit tx: T): Long
Generates a random
Long
value in the rangeLong.MinValue
toLong.MaxValue
.Generates a random
Long
value in the rangeLong.MinValue
toLong.MaxValue
.WARNING: Because it uses the same algorithm as
java.util.Random
, with a seed of only 48 bits, this function will not return all possible long values! - abstract def rawSeed(implicit tx: T): Long
- abstract def rawSeed_=(seed: Long)(implicit tx: T): Unit
Resets the internal seed value to the given argument.
Resets the internal seed value to the given argument. This is a raw seed value as obtained from
getRawSeed
. For user operation, usesetSeed
instead, which further scrambles the seed value. - abstract def setSeed(seed: Long)(implicit tx: T): Unit
Resets the internal seed value to the given argument.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated