Interval.new
Interval.newstartendinterval_type
Group: DateTime
Documentation
Creates an interval.
Arguments
start
: The start of the interval. (Included by default)end
: The end of the interval. (Excluded by default)interval_type
: The type of interval to create. (End_Exclusive by default)
Examples
Create the bounds-exclusive range from 0.1 to 0.5.
import Standard.Base.Data.Interval.Interval
import Standard.Base.Data.Interval.Interval_Type
example_exclusive = Interval.new 0.1 0.5 Interval_Type.Exclusive
Create the start-exclusive range from 1 to 5.
import Standard.Base.Data.Interval.Interval
import Standard.Base.Data.Interval.Interval_Type
example_start_exclusive = Interval.new 1 5 Interval_Type.Start_Exclusive
Create the end-exclusive range from 1 to 5.
import Standard.Base.Data.Interval.Interval
import Standard.Base.Data.Interval.Interval_Type
example_end_exclusive = Interval.new 1 5 Interval_Type.End_Exclusive
Create the inclusive range from 0 to 0.
import Standard.Base.Data.Interval.Interval
import Standard.Base.Data.Interval.Interval_Type
example_inclusive = Interval.new 0 0 Interval_Type.Inclusive