namespace utility { public class DateImpl: Date { private int iYear; private int iMonth; private int iDay; public DateImpl(int pYear, int pMonth, int pDay) { iYear = pYear; iMonth = pMonth; iDay = pDay; } public int Year { get { return iYear; } set { iYear = value; } } public int Month { get { return iMonth; } set { iMonth = value; } } public int Day { get { return iDay; } set { iDay = value; } } public override bool Equals(object pObject) { DateImpl tDateImpl = (DateImpl)pObject; return this==tDateImpl; } public static bool operator ==(DateImpl pLeft, DateImpl pRight) { return pLeft.iYear ==pRight.iYear && pLeft.iMonth==pRight.iMonth && pLeft.iDay ==pRight.iDay; } public static bool operator !=(DateImpl pLeft, DateImpl pRight) { return ! (pLeft==pRight); } public override int GetHashCode() { return 0; } public int CompareTo(object pObject) { DateImpl tDateImpl = (DateImpl)pObject; int tResult = iYear - tDateImpl.iYear; if (tResult==0) { tResult = iMonth - tDateImpl.iMonth; if (tResult==0) { tResult = iDay - tDateImpl.iDay; } } return tResult; } public override string ToString() { return iYear + "-" + iMonth/10 + iMonth%10 + "-" + iDay/10 + iDay%10; } } }