예제 #1
0
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(CommentReliablePdu rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }

            ivarsEqual = base.Equals(rhs);

            if (!(_numberOfFixedDatumRecords == rhs._numberOfFixedDatumRecords))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfVariableDatumRecords == rhs._numberOfVariableDatumRecords))
            {
                ivarsEqual = false;
            }

            if (!(_fixedDatumRecords.Count == rhs._fixedDatumRecords.Count))
            {
                ivarsEqual = false;
            }
            if (ivarsEqual)
            {
                for (int idx = 0; idx < _fixedDatumRecords.Count; idx++)
                {
                    if (!(_fixedDatumRecords[idx].Equals(rhs._fixedDatumRecords[idx])))
                    {
                        ivarsEqual = false;
                    }
                }
            }


            if (!(_variableDatumRecords.Count == rhs._variableDatumRecords.Count))
            {
                ivarsEqual = false;
            }
            if (ivarsEqual)
            {
                for (int idx = 0; idx < _variableDatumRecords.Count; idx++)
                {
                    if (!(_variableDatumRecords[idx].Equals(rhs._variableDatumRecords[idx])))
                    {
                        ivarsEqual = false;
                    }
                }
            }


            return(ivarsEqual);
        }
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(CommentReliablePdu rhs)
        {
            bool ivarsEqual = true;

            if(rhs.GetType() != this.GetType())
                return false;

            ivarsEqual = base.Equals(rhs);

            if( ! (_numberOfFixedDatumRecords == rhs._numberOfFixedDatumRecords)) ivarsEqual = false;
            if( ! (_numberOfVariableDatumRecords == rhs._numberOfVariableDatumRecords)) ivarsEqual = false;

            if( ! (_fixedDatumRecords.Count == rhs._fixedDatumRecords.Count)) ivarsEqual = false;
            if(ivarsEqual)
            {
                for(int idx = 0; idx < _fixedDatumRecords.Count; idx++)
                {
                    if( ! ( _fixedDatumRecords[idx].Equals(rhs._fixedDatumRecords[idx]))) ivarsEqual = false;
                }
            }

            if( ! (_variableDatumRecords.Count == rhs._variableDatumRecords.Count)) ivarsEqual = false;
            if(ivarsEqual)
            {
                for(int idx = 0; idx < _variableDatumRecords.Count; idx++)
                {
                    if( ! ( _variableDatumRecords[idx].Equals(rhs._variableDatumRecords[idx]))) ivarsEqual = false;
                }
            }

            return ivarsEqual;
        }