IntervalRelation
public enum IntervalRelation : InvertibleEnum
Implementation of Allen’s Interval Algebra.
Background
From Thomas A. Alspaugh:
In 1983 James F. Allen published a paper in which he proposed thirteen basic relations between time intervals that are distinct, exhaustive, and qualitative.
- Distinct because no pair of definite intervals can be related by more than one of the relationships
- Exhaustive because any pair of definite intervals are described by one of the relations
- Qualitative (rather than quantitative) because no numeric time spans are considered
The naming conventions used in this implementation are those of Allen, refined by Krokhin et al..
-
x
precedesy
x: |---| y: |---|
Declaration
Swift
case precedes
-
x
meetsy
x: |----| y: |----|
Declaration
Swift
case meets
-
x
overlapsy
x: |------| y: |------|
Declaration
Swift
case overlaps
-
x
is finished byy
x: |---------| y: |----|
Declaration
Swift
case finishedBy
-
x
containsy
x: |----------| y: |----|
Declaration
Swift
case contains
-
x
startsy
x: |-----| y: |----------|
Declaration
Swift
case starts
-
x
equalsy
x: |----------| y: |----------|
Declaration
Swift
case equals
-
x
is started byy
x: |----------| y: |-----|
Declaration
Swift
case startedBy
-
x
is contained byy
x: |----| y: |----------|
Declaration
Swift
case containedBy
-
x
finishesy
x: |-----| y: |----------|
Declaration
Swift
case finishes
-
x
is overlapped byy
x: |------| y: |------|
Declaration
Swift
case overlappedBy
-
x
is met byy
x: |----| y: |----|
Declaration
Swift
case metBy
-
x
is preceded byy
x: |---| y: |---|
Declaration
Swift
case precededBy