Int.G.Range

class Range[A <: Any.Int](_start: A, _size: Int) extends Val.Range[A] with Able.Size with Able.Stream[A]

Int Specialized Generic Range

To be used with Int based opaque values.

Source
Range.scala
trait Any.Z.PrimitiveTag.Int
trait Any.Z.PrimitiveTag
trait Able.Stream[Int.G.Range.A]
trait Able.Size
class Range[Int.G.Range.A]
trait Able.Contain[Int.G.Range.A]
class java.lang.Object
trait scala.Matchable
class Any

Def

Constructor

def this(start: A, end: A, endIn: Boolean)

Body

inline def ~~: Int.G.Stream[A]

Alias to "stream"

Alias to "stream"

Source
Range.scala
override def contains(v: A): Boolean

Check if within

Check if within

Returns true if this range contains specified range

 (1 <> 9) contains (3 <> 7)  // Returns: true

 (1 <> 5) contains (3 <> 7)  // Returns: false
Definition Classes
Source
Range.scala
def contains(r: Int.G.Range[A]): Boolean
override def contains(r: Range[A]): Boolean

Check if within

Check if within

Returns true if this range contains specified range

 (1 <> 9) contains (3 <> 7)  // Returns: true

 (1 <> 5) contains (3 <> 7)  // Returns: false
Definition Classes
Source
Range.scala
def end: A
def endIsIn: Boolean
def endX: A
override def equals(v: Any): Boolean
Definition Classes
Range -> Any
Inherited from
Range
Source
__.scala
override def isEmpty: Boolean

Empty check

Empty check

Checks if the range is able contain anything.

For empty range the start and end values are the same and the end value is not inclusive

Definition Classes
Source
Range.scala
def join(v: A): this.type
def join(r: Range[A]): this.type
def overlaps(r: Int.G.Range[A]): Boolean
def overlaps(r: Range[A]): Boolean
inline def raw(using sp: Specialized.Primitive[A]): s.Range

Primitive range

Primitive range

Returns primitive specialized range implementation.

The method will not compile for reference types.

Inherited from
Range
Source
__.scala
def size: Int
def start: A
def stepStream(f: A => A): Stream[A]

Stream of calculated values

Stream of calculated values

Returns a stream starting with the first range value. Every next value is calculated by applying the given function to the prior value. The stream ends when the function result is no longer within range.

 (1 <> 10).stepStream( _ + 3).tp  // Prints: Stream(1, 4, 7, 10)
Inherited from
Range
Source
__.scala
inline def toArray: Array[A]
inline def toBuffer: Int.G.Buffer[A]