AnyRef.G.Range

class Range[A](val start: A, val end: A, val endIsIn: Boolean)(using val ordering: Ordering[A]) extends AnyRef.G.Range.X.Abstract[A]
class AnyRef.G.Range.X.Abstract[AnyRef.G.Range.A]
class AnyRef.G.Range.X.Base[AnyRef.G.Range.A, Range[AnyRef.G.Range.A]]
class Range[AnyRef.G.Range.A]
trait Able.Contain[AnyRef.G.Range.A]
class java.lang.Object
trait scala.Matchable
class Any

Def

def contains(v: A): Boolean

Check if within

Check if within

Returns true if this range contains specified value

 (1 <> 9) contains 3  // Returns: true
Inherited from
Range
Source
__.scala
def contains(v: 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
Inherited from
Range
Source
__.scala
val end: A
val endIsIn: Boolean
override def equals(v: Any): Boolean
Definition Classes
Range -> Any
Inherited from
Range
Source
__.scala
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

Inherited from
Range
Source
__.scala
def join(r: Range[A]): this.type
Inherited from
Base
Source
Range.scala
def join(v: A): this.type
Inherited from
Base
Source
Range.scala
def makeNew(s: A, e: A, in: Boolean): Range[A]
Inherited from
Abstract
Source
Range.scala
val ordering: Ordering[A]
Inherited from
Base
Source
Range.scala
def overlaps(r: Range[A]): Boolean
Inherited from
Base
Source
Range.scala
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
val 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