예제 #1
0
 /// <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));
     }
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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;
 }
예제 #4
0
 /// <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;
 }
예제 #5
0
 public static bool IsValidNonNegFlavor(INT i)
 {
     return(i.Value != null && i.Value.HasValue && i.Value.Value >= 0);
 }
예제 #6
0
 public static bool IsValidPosFlavor(INT i)
 {
     return(i.Value != null && i.Value.HasValue && i.Value.Value > 0);
 }
예제 #7
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);
        }
예제 #8
0
 /// <summary>
 /// Removes <paramref name="item"/> from the SLIST instance
 /// </summary>
 public bool Remove(INT item)
 {
     return(this.m_digits.Remove(item));
 }
예제 #9
0
 /// <summary>
 /// Indicates whether this instance of SLIST contains <paramref name="item"/>
 /// </summary>
 public bool Contains(INT item)
 {
     return(this.m_digits.Contains(item));
 }
예제 #10
0
 /// <summary>
 /// Adds <paramref name="item"/> to the SLIST
 /// </summary>
 public void Add(INT item)
 {
     this.m_digits.Add(item);
 }
예제 #11
0
 /// <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);
 }
예제 #12
0
 /// <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));
 }