/// <summary> /// Get the maximum of this integer and <paramref name="other"/> /// </summary> public INT Min(INT other) { if (other == null || other.IsNull) { return(this.Clone() as INT); } else if (this.IsNull) { return(other.Clone() as INT); } else if (other < this) { return(new INT((int)other)); } else { return(new INT((int)this)); } }
/// <summary> /// Determine if <paramref name="other"/> is semantically equal to the current instance /// of <see cref="T:INT"/> /// </summary> /// <param name="other">The other instance of <see cref="T:INT"/> to compare</param> /// <returns>A <see cref="T:BL"/> indicating whether the two instance of <see cref="T:INT"/> are equivalent</returns> public override BL SemanticEquals(IAny other) { var baseEq = base.SemanticEquals(other); if (!(bool)baseEq) { return(baseEq); } // Null-flavored if (this.IsNull && other.IsNull) { return(true); } else if (this.IsNull ^ other.IsNull) { return(false); } // Values are equal? INT intOther = other as INT; if (intOther == null) { return(false); } else if (intOther.Value.HasValue && this.Value.HasValue && intOther.Value.Value == this.Value.Value) { return(true); } else if (intOther.UncertainRange != null && !intOther.UncertainRange.IsNull && this.UncertainRange != null && !this.UncertainRange.IsNull) { return(intOther.UncertainRange.SemanticEquals(this.UncertainRange)); } return(false); }
/// <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; }
public static bool IsValidNonNegFlavor(INT i) { return(i.Value != null && i.Value.HasValue && i.Value.Value >= 0); }
public static bool IsValidPosFlavor(INT i) { return(i.Value != null && i.Value.HasValue && i.Value.Value > 0); }
/// <summary> /// Determine if this INT equals another INT /// </summary> public bool Equals(INT other) { bool result = base.Equals((QTY <Nullable <Int32> >)other); return(result); }
/// <summary> /// Removes <paramref name="item"/> from the SLIST instance /// </summary> public bool Remove(INT item) { return(this.m_digits.Remove(item)); }
/// <summary> /// Indicates whether this instance of SLIST contains <paramref name="item"/> /// </summary> public bool Contains(INT item) { return(this.m_digits.Contains(item)); }
/// <summary> /// Adds <paramref name="item"/> to the SLIST /// </summary> public void Add(INT item) { this.m_digits.Add(item); }
/// <summary> /// Inserts <paramref name="item"/> at the specified <paramref name="index"/> /// </summary> public void Insert(int index, INT item) { this.m_digits.Insert(index, item); }
/// <summary> /// Return the index of <paramref name="item"/> within this SLIST /// </summary> /// <param name="item">The item for which a search should be conducted</param> public int IndexOf(INT item) { return(this.m_digits.IndexOf(item)); }