Interval
Class
Creation
The creation procedure
Interval measurement
The measurement of an interval is done by applying the query
Comparison
-
infix < andinfix > compare two intervals on a "strict" basis. This means thatint_1 < int_2 isTrue ifint_1 starts and ends strictly beforeint_2 . In other words,int_1 must have a start bound less than that ofint_2 and an end bound less than that ofint_2 . -
infix <= andinfix >= compare two intervals on a non-strict basis. So,int_1 <= int_2 isTrue ifint_1 has a start bound less than or equal to that ofint_2 and an end bound less than or equal to that ofint_2 . -
is_equal (or~ )performs object comparison. -
intersects is true if one (target)INTERVAL shares some of the same bounded area with a second (argument)INTERVAL . -
overlaps is similar tointersects with the exception that the argumentINTERVAL has to be after the targetINTERVAL .is_overlapped is the opposite ofoverlaps . -
meets andis_met are used to test whether two intervals have a common bound. -
strict_includes can be used to test whether the targetINTERVAL strictly includes the argumentINTERVAL . So,int_1.strict_includes (int_2) will beTrue if the start bound ofint_2 is greater than the start bound ofint_1 and the end bound ofint_2 is less than the end bound ofint_1 .is_strict_included_by provides the opposite ofstrict_includes . -
includes andis_included_by test for inclusion on a non-strict basis.
Status Report
-
empty isTrue if theINTERVAL is empty, i.e., if the value of the start bound is equal to the value of the end bound. -
has ,strict_before ,strict_after ,before , andafter test the position of an element relative to the current interval.
Element change
Operations
-
union provides a newINTERVAL that includes the entire range covered by both the targetINTERVAL and an argumentINTERVAL which intersects the target. -
intersection returns a newINTERVAL that represents the area common to both the targetINTERVAL and the argumentINTERVAL .intersection returnsVoid if the target and argument do not intersect. -
gather requires that a target and argumentINTERVAL have a common bound (i.e.,int_1.meets (int_2) isTrue ) and then returns a newINTERVAL with the union of the two.