Пример #1
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(AggregateMarking rhs)
        {
            bool ivarsEqual = true;

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

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

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


            return(ivarsEqual);
        }
Пример #2
0
 ///<summary>
 ///marking for aggregate; first char is charset type, rest is char data
 ///</summary>
 public void setAggregateMarking(AggregateMarking pAggregateMarking)
 {
     _aggregateMarking = pAggregateMarking;
 }
 ///<summary>
 ///marking for aggregate; first char is charset type, rest is char data
 ///</summary>
 public void setAggregateMarking(AggregateMarking pAggregateMarking)
 {
     _aggregateMarking = pAggregateMarking;
 }
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(AggregateMarking rhs)
        {
            bool ivarsEqual = true;

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

            if( ! (_characterSet == rhs._characterSet)) ivarsEqual = false;

            if( ! (rhs._characters.Length == 31)) ivarsEqual = false;
            if(ivarsEqual)
            {

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

            return ivarsEqual;
        }