예제 #1
0
 public static bool Starts(this SmallTimeInterval x, SmallTimeInterval y) => x.Start == y.Start && x.End < y.End;
예제 #2
0
 public static bool Meets(this SmallTimeInterval x, SmallTimeInterval y) => x.End == y.Start;
예제 #3
0
 public static bool OverlapsWith(this SmallTimeInterval x, SmallTimeInterval y) => x.Start < y.Start && y.Start < x.End && x.End < y.End;
예제 #4
0
    public static TemporalIntervalRelation GetTemporalIntervalRelation(this SmallTimeInterval x, SmallTimeInterval y)
    {
        TemporalIntervalRelation relation;

        if (x.Before(y))
        {
            relation = TemporalIntervalRelation.Precedes;
        }
        else if (x.Meets(y))
        {
            relation = TemporalIntervalRelation.Meets;
        }
        else if (x.OverlapsWith(y))
        {
            relation = TemporalIntervalRelation.OverlapsWith;
        }
        else if (x.Starts(y))
        {
            relation = TemporalIntervalRelation.Starts;
        }
        else if (x.During(y))
        {
            relation = TemporalIntervalRelation.During;
        }
        else if (x.Finishes(y))
        {
            relation = TemporalIntervalRelation.Finishes;
        }
        else if (x.Equal(y))
        {
            relation = TemporalIntervalRelation.IsEqualTo;
        }
        else if (x.After(y))
        {
            relation = TemporalIntervalRelation.IsPrecededBy;
        }
        else if (x.MetBy(y))
        {
            relation = TemporalIntervalRelation.IsMetBy;
        }
        else if (x.OverlappedBy(y))
        {
            relation = TemporalIntervalRelation.IsOverlappedBy;
        }
        else if (x.StartedBy(y))
        {
            relation = TemporalIntervalRelation.IsStartedBy;
        }
        else if (x.Contains(y))
        {
            relation = TemporalIntervalRelation.Contains;
        }
        else if (x.FinishedBy(y))
        {
            relation = TemporalIntervalRelation.IsFinishedBy;
        }
        else
        {
            throw new InvalidOperationException();
        }

        return(relation);
    }
예제 #5
0
 public static bool Before(this SmallTimeInterval x, SmallTimeInterval y) => x.End < y.Start;
예제 #6
0
 public static bool Contains(this SmallTimeInterval x, SmallTimeInterval y) => y.During(x);
예제 #7
0
 public static bool FinishedBy(this SmallTimeInterval x, SmallTimeInterval y) => y.Finishes(x);
예제 #8
0
 public static bool OverlappedBy(this SmallTimeInterval x, SmallTimeInterval y) => y.OverlapsWith(x);
예제 #9
0
 public static bool StartedBy(this SmallTimeInterval x, SmallTimeInterval y) => y.Starts(x);
예제 #10
0
 public static bool MetBy(this SmallTimeInterval x, SmallTimeInterval y) => y.Meets(x);
예제 #11
0
 public static bool After(this SmallTimeInterval x, SmallTimeInterval y) => y.Before(x);
예제 #12
0
 public static bool Equal(this SmallTimeInterval x, SmallTimeInterval y) => x.Start == y.Start && x.End == y.End;
예제 #13
0
 public static bool Finishes(this SmallTimeInterval x, SmallTimeInterval y) => y.Start < x.Start && x.End == y.End;
예제 #14
0
 public static bool During(this SmallTimeInterval x, SmallTimeInterval y) => y.Start < x.Start && x.End < y.End;