override equals method for class TimeInterval