コード例 #1
0
        ///
        ///	 <summary> * equals - returns true if both JDFNumberRangeList are equal otherwise false
        ///	 *  </summary>
        ///	 * <returns> boolean - true if equal otherwise false </returns>
        ///
        public override sealed bool Equals(object other)
        {
            if (this == other)
            {
                return(true);
            }
            if (other == null)
            {
                return(false);
            }
            if (!other.GetType().Equals(this.GetType()))
            {
                return(false);
            }

            int          size           = rangeList.Count;
            JDFRangeList rangeListOther = (JDFRangeList)other;
            int          sizeOther      = rangeListOther.rangeList.Count;

            if (size != sizeOther)
            {
                return(false);
            }
            for (int i = 0; i < size; i++)
            {
                JDFRange range      = this[i];
                JDFRange rangeOther = rangeListOther[i];

                if (!range.Equals(rangeOther))
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
        ///
        ///	 <summary> * isPartOfRange - check whether JDFRangeList 'x' is within this range list
        ///	 *  </summary>
        ///	 * <param name="x"> the range list to test </param>
        ///	 * <returns> boolean - true if range list 'x' is within 'this' range list, else false </returns>
        ///
        public bool isPartOfRange(JDFRangeList x)
        {
            int size = x.Count;

            for (int i = 0; i < size; i++)
            {
                JDFRange range = x[i];
                if (isPartOfRange(range))
                {
                    return(true);
                }
            }
            return(false);
        }