Exemple #1
0
 public static bool IsMetBy(this SmallDateInterval x, SmallDateInterval y) => y.Meets(x);
Exemple #2
0
        public static TemporalIntervalRelation GetTemporalIntervalRelation(this SmallDateInterval x, SmallDateInterval y)
        {
            TemporalIntervalRelation relation;

            if (x.Precedes(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.IsPrecededBy(y))
            {
                relation = TemporalIntervalRelation.IsPrecededBy;
            }
            else if (x.IsMetBy(y))
            {
                relation = TemporalIntervalRelation.IsMetBy;
            }
            else if (x.IsOverlappedBy(y))
            {
                relation = TemporalIntervalRelation.IsOverlappedBy;
            }
            else if (x.IsStartedBy(y))
            {
                relation = TemporalIntervalRelation.IsStartedBy;
            }
            else if (Contains(x, y))
            {
                relation = TemporalIntervalRelation.Contains;
            }
            else if (x.IsFinishedBy(y))
            {
                relation = TemporalIntervalRelation.IsFinishedBy;
            }
            else if (x.IsEqualTo(y))
            {
                relation = TemporalIntervalRelation.IsEqualTo;
            }
            else
            {
                throw new InvalidOperationException();
            }

            return(relation);
        }
        public static TemporalIntervalRelation GetTemporalIntervalRelation(this SmallDateInterval x, SmallDateInterval y)
        {
            TemporalIntervalRelation relation;

            if (x.Before(y))
            {
                relation = TemporalIntervalRelation.Before;
            }
            else if (x.Meets(y))
            {
                relation = TemporalIntervalRelation.Meets;
            }
            else if (x.Overlaps(y))
            {
                relation = TemporalIntervalRelation.Overlaps;
            }
            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.Equal;
            }
            else if (x.After(y))
            {
                relation = TemporalIntervalRelation.After;
            }
            else if (x.MetBy(y))
            {
                relation = TemporalIntervalRelation.MetBy;
            }
            else if (x.OverlappedBy(y))
            {
                relation = TemporalIntervalRelation.OverlappedBy;
            }
            else if (x.StartedBy(y))
            {
                relation = TemporalIntervalRelation.StartedBy;
            }
            else if (x.Contains(y))
            {
                relation = TemporalIntervalRelation.Contains;
            }
            else if (x.FinishedBy(y))
            {
                relation = TemporalIntervalRelation.FinishedBy;
            }
            else
            {
                throw new InvalidOperationException();
            }

            return(relation);
        }