Period

Period is a custom Time range implementation

It does have few time specific methods, like '.length', '.dayStream', '.lastDay', which are not available in general range.

Source
Period.scala
class Range[Time]
class java.lang.Object
trait scala.Matchable
class Any

Def

def contains(v: Time): 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[Time]): 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: Time
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
Inherited from
Base
Source
Range.scala
def join(v: Time): this.type
Inherited from
Base
Source
Range.scala
Inherited from
Base
Source
Range.scala
def overlaps(r: Range[Time]): Boolean
Inherited from
Base
Source
Range.scala
inline def raw(using sp: Specialized.Primitive[Time]): s.Range

Primitive range

Primitive range

Returns primitive specialized range implementation.

The method will not compile for reference types.

Inherited from
Range
Source
__.scala

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