AnyRef.G.Range.X.Base

abstract class Base[A, THIS <: Range[A]] extends Range[A]
class Range[AnyRef.G.Range.X.Base.A]
trait Able.Contain[AnyRef.G.Range.X.Base.A]
class java.lang.Object
trait scala.Matchable
class Any
class Period
class AnyRef.G.Range.X.Abstract[AnyRef.G.Range.X.Abstract.A]
class AnyRef.G.Range[AnyRef.G.Range.A]

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
def end: A

Make value

Make value

End value of the range

Inherited from
Range
Source
__.scala
def endIsIn: Boolean

Inclusive check

Inclusive check

If true, the end value is inclusive

 (10 <>> 15) contains 15   // Returns: false

 // Exclusive 15 does not contain 15
Inherited from
Range
Source
__.scala
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(v: A): this.type
def join(r: Range[A]): this.type
protected def makeNew(s: A, e: A, in: Boolean): this.type

Ordering

Ordering

Ordering defining range

Ordering defining type elements comparison

Inherited from
Range
Source
__.scala
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 start: A

From value

From value

Start value of the range

Inherited from
Range
Source
__.scala
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