/// <summary> /// Determine if this IVL of T is equal to another IVL of T /// </summary> public bool Equals(IVL <T> other) { bool result = false; if (other != null) { result = base.Equals((SXCM <T>)other) && (other.High != null ? other.High.Equals(this.High) : this.High == null) && other.HighClosed == this.HighClosed && (other.Low != null ? other.Low.Equals(this.Low) : this.Low == null) && other.LowClosed == this.LowClosed && (other.OriginalText != null ? other.OriginalText.Equals(this.OriginalText) : this.OriginalText == null) && (other.Width != null ? other.Width.Equals(this.Width) : this.Width == null); } return(result); }
/// <summary> /// Create a new instance of the PIVL type using the phase and period specified /// </summary> /// <param name="phase">The phase of the PIVL</param> /// <param name="period">The period of the PIVL</param> /// <param name="count">The maximum number of times the PIVL can repreat</param> public PIVL(IVL <T> phase, PQ period, INT count) : this(phase, period) { this.Count = count; }
/// <summary> /// Create a new instance of the PIVL type using the phase and period specified /// </summary> /// <param name="phase">The phase of the PIVL</param> /// <param name="frequency">The period of the PIVL</param> /// <param name="count">The maximum number of times the PIVL can repreat</param> public PIVL(IVL <T> phase, RTO <INT, PQ> frequency, INT count) : this(phase, frequency) { this.Count = count; }
/// <summary> /// Create a new instance of the PIVL type using the phase and period specified /// </summary> /// <param name="phase">The phase of the PIVL</param> /// <param name="frequency">The period of the PIVL</param> public PIVL(IVL <T> phase, RTO <INT, PQ> frequency) { this.Phase = phase; this.Frequency = frequency; }
/// <summary> /// Create a new instance of the PIVL type using the phase and period specified /// </summary> /// <param name="phase">The phase of the PIVL</param> /// <param name="period">The period of the PIVL</param> public PIVL(IVL <T> phase, PQ period) { this.Phase = phase; this.Period = period; }
public IVL <TS> ToIVL() { // Absolutely precise if (this.DateValuePrecision == DatePrecision.Full || this.DateValuePrecision == DatePrecision.FullNoTimezone) { return new IVL <TS>(this, this) { LowClosed = true, HighClosed = true } } ; IVL <TS> retVal = new IVL <TS>(); int maxMonth = DateTime.DaysInMonth(this.DateValue.Year, this.DateValue.Month); // Convert switch (this.DateValuePrecision) { case DatePrecision.Year: // Year precision : from Jan 1 YEAR to Dec 31 YEAR return(new IVL <TS>( new TS(new DateTime(this.DateValue.Year, 1, 1, 0, 0, 0, 0), DatePrecision.Full), new TS(new DateTime(this.DateValue.Year, 12, 31, 23, 59, 59, 999), DatePrecision.Full) ) { LowClosed = true, HighClosed = true }); case DatePrecision.Month: // Month precision : from MONTH 1 YEAR to MONTH max YEAR return(new IVL <TS>( new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, 1, 0, 0, 0, 0), DatePrecision.Full), new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, maxMonth, 23, 59, 59, 999), DatePrecision.Full) ) { LowClosed = true, HighClosed = true }); case DatePrecision.Day: // Day precision return(new IVL <TS>( new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, 0, 0, 0, 0), DatePrecision.Full), new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, 23, 59, 59, 999), DatePrecision.Full) ) { LowClosed = true, HighClosed = true }); case DatePrecision.Hour: // Hour precision case DatePrecision.HourNoTimezone: return(new IVL <TS>( new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, this.DateValue.Hour, 0, 0, 0), DatePrecision.Full), new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, this.DateValue.Hour, 59, 59, 999), DatePrecision.Full) ) { LowClosed = true, HighClosed = true }); case DatePrecision.Minute: // Minute precision case DatePrecision.MinuteNoTimezone: return(new IVL <TS>( new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, this.DateValue.Hour, this.DateValue.Minute, 0, 0), DatePrecision.Full), new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, this.DateValue.Hour, this.DateValue.Minute, 59, 999), DatePrecision.Full) ) { LowClosed = true, HighClosed = true }); case DatePrecision.Second: // Second precision case DatePrecision.SecondNoTimezone: return(new IVL <TS>( new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, this.DateValue.Hour, this.DateValue.Minute, this.DateValue.Second, 0), DatePrecision.Full), new TS(new DateTime(this.DateValue.Year, this.DateValue.Month, this.DateValue.Day, this.DateValue.Hour, this.DateValue.Minute, this.DateValue.Second, 999), DatePrecision.Full) ) { LowClosed = true, HighClosed = true }); default: return(new IVL <TS>(this, this) { }); } }
public static bool IsValidLowFlavor(IVL <T> ivl) { return((ivl.Low != null && ivl.High == null && ivl.LowClosed == true && !ivl.HighClosed.HasValue && ivl.Width == null) ^ (ivl.NullFlavor != null)); }
public static bool IsValidWidthFlavor(IVL <T> ivl) { // IVL must have a Width and either a High / Low return((ivl.Low == null && ivl.High == null && !ivl.LowClosed.HasValue && !ivl.HighClosed.HasValue && ivl.Width != null) ^ (ivl.NullFlavor != null)); }
/// <summary> /// Create a new instance of the GTS class with the specified <paramref name="hull"/> /// </summary> /// <param name="hull">The IVL<TS> to set as the hull</param> public GTS(IVL <TS> hull) : base() { this.Hull = hull; }
/// <summary> /// Create a new instance of the EIVL class with the specified <paramref name="operatorType"/>, <paramref name="eventType"/> and <paramref name="offset"/> /// </summary> /// <param name="eventType">The type of event that this interval relates to</param> /// <param name="offset">The offset (time interval)</param> public EIVL(DomainTimingEventType eventType, IVL <PQ> offset) { this.Offset = offset; this.Event = eventType; }