示例#1
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(NamedLocation rhs)
        {
            bool ivarsEqual = true;

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

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

            return(ivarsEqual);
        }
示例#2
0
 ///<summary>
 ///named location
 ///</summary>
 public void setNamedLocationID(NamedLocation pNamedLocationID)
 {
     _namedLocationID = pNamedLocationID;
 }
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(NamedLocation rhs)
        {
            bool ivarsEqual = true;

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

            if( ! (_stationName == rhs._stationName)) ivarsEqual = false;
            if( ! (_stationNumber == rhs._stationNumber)) ivarsEqual = false;

            return ivarsEqual;
        }
示例#4
0
 ///<summary>
 ///named location
 ///</summary>
 public void setNamedLocationID(NamedLocation pNamedLocationID)
 {
     _namedLocationID = pNamedLocationID;
 }