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..
-
xprecedesyx: |---| y: |---|Declaration
Swift
case precedes -
xmeetsyx: |----| y: |----|Declaration
Swift
case meets -
xoverlapsyx: |------| y: |------|Declaration
Swift
case overlaps -
xis finished byyx: |---------| y: |----|Declaration
Swift
case finishedBy -
xcontainsyx: |----------| y: |----|Declaration
Swift
case contains -
xstartsyx: |-----| y: |----------|Declaration
Swift
case starts -
xequalsyx: |----------| y: |----------|Declaration
Swift
case equals -
xis started byyx: |----------| y: |-----|Declaration
Swift
case startedBy -
xis contained byyx: |----| y: |----------|Declaration
Swift
case containedBy -
xfinishesyx: |-----| y: |----------|Declaration
Swift
case finishes -
xis overlapped byyx: |------| y: |------|Declaration
Swift
case overlappedBy -
xis met byyx: |----| y: |----|Declaration
Swift
case metBy -
xis preceded byyx: |---| y: |---|Declaration
Swift
case precededBy
View on GitHub
Install in Dash
IntervalRelation Enumeration Reference