final case class Range[A](lo: Ex[A], hi: Ex[A], gen: Random)(implicit num: Num[A]) extends Ex[A] with Act with ProductWithAdjuncts with Product with Serializable
A random number between a given lo
and a given hi
boundary.
The boundaries are inclusive
for integer numbers. For floating point numbers, the hi
bound is exclusive.
This is both an expression and an action. The action draws a new random number, the expression reports the last drawn value.
Example:
val gen = Random() val r1to10 = gen.range(1, 10) Act( r1to10, // draw new number PrintLn("Random number (1 to 10): " ++ r1to10.toStr) // print current value )
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Range
- Serializable
- ProductWithAdjuncts
- Act
- Ex
- Flow
- Lazy
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
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
- def adjuncts: List[Adjunct]
- Definition Classes
- Range → ProductWithAdjuncts
- 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
- final def expand[T <: Txn[T]](implicit ctx: Context[T], tx: T): Repr[T]
- Definition Classes
- Lazy
- val gen: Random
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val hi: Ex[A]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val lo: Ex[A]
- def mkRepr[T <: Txn[T]](implicit ctx: Context[T], tx: T): Repr[T]
- 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()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def productPrefix: String
- Definition Classes
- Range → Product
- final val ref: AnyRef
- Attributes
- protected
- Definition Classes
- Lazy
- Annotations
- @transient()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def update: Act
Convenient method that returns the
Range
itself.Convenient method that returns the
Range
itself. This can be used for additional clarity when writingBang() ---> x.update
instead ofBang() ---> x
. - 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