Beispiel #1
0
        /// <summary>
        /// 是否相等
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (!(obj is HashObjectList))
            {
                return(false);
            }

            HashObjectList that = (HashObjectList)obj;

            if (this.Count != that.Count)
            {
                return(false);
            }

            for (int i = 0; i < this.Count; i++)
            {
                if (!(this[i].Equals(that[i])))
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// 取一个范围,参数不对会抛出异常
        /// </summary>
        /// <param name="index"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public new IHashMapList GetRange(int index, int count)
        {
            List <IHashMap> list   = base.GetRange(index, count);
            IHashMapList    answer = new HashObjectList(count);

            foreach (IHashMap item in list)
            {
                answer.Add(item);
            }
            return(answer);
        }