/pyjs/tests/test015.py
Python | 18 lines | 16 code | 2 blank | 0 comment | 5 complexity | 9fcc94348109983c688f7d6b85af0c23 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
- class TimeSlot:
- def __init__(self, dayOfWeek, startMinutes, endMinutes):
- self.dayOfWeek = dayOfWeek
- self.startMinutes = startMinutes
- self.endMinutes = endMinutes
-
- def compareTo(self, other):
- if self.dayOfWeek < other.dayOfWeek:
- return -1
- elif self.dayOfWeek > other.dayOfWeek:
- return 1
- else:
- if self.startMinutes < other.startMinutes:
- return -1
- elif self.startMinutes > other.startMinutes:
- return 1
- return 0