public bool? Before(TemporalInformation s) { bool? _answer = (!this.endDate.HasValue || !s.startDate.HasValue) ? null : (bool?)(this.endDate.Value < s.startDate.Value); return _answer; }
public TemporalInformation Clone() { TemporalInformation _answer = new TemporalInformation() { startYear = this.startYear , startMonth = this.startMonth , startDay = this.startDay , endYear = this.endYear , endMonth = this.endMonth , endDay = this.endDay }; return _answer; }
public bool? During(TemporalInformation s) { bool? _answer = (!this.startDate.HasValue || !s.startDate.HasValue || !this.endDate.HasValue || !s.endDate.HasValue) ? null : (bool?)( (this.startDate.Value > s.startDate.Value && this.endDate.Value <= s.endDate.Value) || (this.startDate.Value >= s.startDate.Value && this.endDate.Value < s.endDate.Value) ); return _answer; }
public TimeSpan? ElapsedTime(TemporalInformation s) { TimeSpan? _answer = null; if (!_answer.HasValue) { bool? _answerRelation = this.Before(s); if (_answerRelation.HasValue && _answerRelation.Value) _answer = s.startDate.Value.Subtract(this.endDate.Value); } if (!_answer.HasValue) { bool? _answerRelation = this.After(s); if (_answerRelation.HasValue && _answerRelation.Value) _answer = this.startDate.Value.Subtract(s.endDate.Value); } if (!_answer.HasValue) { bool? _answerRelation = this.Same(s); if (_answerRelation.HasValue && _answerRelation.Value) _answer = TimeSpan.Zero; } if (!_answer.HasValue) { bool? _answerRelation = this.MeetsBefore(s); if (_answerRelation.HasValue && _answerRelation.Value) _answer = TimeSpan.Zero; } if (!_answer.HasValue) { bool? _answerRelation = this.MeetsAfter(s); if (_answerRelation.HasValue && _answerRelation.Value) _answer = TimeSpan.Zero; } if (!_answer.HasValue) { bool? _answerRelation = this.Overlaps(s); if (_answerRelation.HasValue && _answerRelation.Value) _answer = TimeSpan.Zero; } if (!_answer.HasValue) { bool? _answerRelation = this.During(s); if (_answerRelation.HasValue && _answerRelation.Value) _answer = TimeSpan.Zero; } return _answer; }
public bool? MeetsAfter(TemporalInformation s) { bool? _answer = (!this.startDate.HasValue || !s.endDate.HasValue) ? null : (bool?)(this.startDate.Value == s.endDate.Value); return _answer; }