Packages

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
Serializable, ProductWithAdjuncts, Act, Ex[A], Flow, Lazy, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Range
  2. Serializable
  3. ProductWithAdjuncts
  4. Act
  5. Ex
  6. Flow
  7. Lazy
  8. Product
  9. Equals
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Range(lo: Ex[A], hi: Ex[A], gen: Random)(implicit num: Num[A])

Type Members

  1. type Repr[T <: Txn[T]] = IExpr[T, A] with IAction[T]
    Definition Classes
    RangeActExFlowLazy

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. def adjuncts: List[Adjunct]
    Definition Classes
    RangeProductWithAdjuncts
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. final def expand[T <: Txn[T]](implicit ctx: Context[T], tx: T): Repr[T]
    Definition Classes
    Lazy
  9. val gen: Random
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. val hi: Ex[A]
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. val lo: Ex[A]
  14. def mkRepr[T <: Txn[T]](implicit ctx: Context[T], tx: T): Repr[T]
    Attributes
    protected
    Definition Classes
    RangeLazy
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. def productElementNames: Iterator[String]
    Definition Classes
    Product
  19. def productPrefix: String
    Definition Classes
    Range → Product
  20. final val ref: AnyRef
    Attributes
    protected
    Definition Classes
    Lazy
    Annotations
    @transient()
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. 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 writing Bang() ---> x.update instead of Bang() ---> x.

  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

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 ProductWithAdjuncts

Inherited from Act

Inherited from Ex[A]

Inherited from Flow

Inherited from Lazy

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped