Exemplo n.º 1
0
        /// <summary> Compares two <code>ModifiableInteger</code> objects numerically.
        ///
        /// </summary>
        /// <param name="anotherInteger">the <code>ModifiableInteger</code> to be compared.
        ///
        /// </param>
        /// <returns> the value <code>0</code> if this <code>ModifiableInteger</code>
        /// is equal to the argument <code>ModifiableInteger</code>; a
        /// value less than <code>0</code> if this
        /// <code>ModifiableInteger</code> is numerically less than the
        /// argument <code>ModifiableInteger</code>; and a value greater
        /// than <code>0</code> if this <code>ModifiableInteger</code> is
        /// numerically greater than the argument
        /// <code>ModifiableInteger</code> (signed comparison).
        /// </returns>
        public virtual int compareTo(ModifiableInteger anotherInteger)
        {
            int thisVal    = this.value_Renamed;
            int anotherVal = anotherInteger.value_Renamed;

            return(thisVal < anotherVal?-1:(thisVal == anotherVal?0:1));
        }
Exemplo n.º 2
0
		/// <summary> Compares two <code>ModifiableInteger</code> objects numerically.
		/// 
		/// </summary>
		/// <param name="anotherInteger">the <code>ModifiableInteger</code> to be compared.
		/// 
		/// </param>
		/// <returns> the value <code>0</code> if this <code>ModifiableInteger</code>
		/// is equal to the argument <code>ModifiableInteger</code>; a
		/// value less than <code>0</code> if this
		/// <code>ModifiableInteger</code> is numerically less than the
		/// argument <code>ModifiableInteger</code>; and a value greater
		/// than <code>0</code> if this <code>ModifiableInteger</code> is
		/// numerically greater than the argument
		/// <code>ModifiableInteger</code> (signed comparison).
		/// </returns>
		public virtual int compareTo(ModifiableInteger anotherInteger)
		{
			int thisVal = this.value_Renamed;
			int anotherVal = anotherInteger.value_Renamed;
			
			return thisVal < anotherVal?- 1:(thisVal == anotherVal?0:1);
		}