/pyjs/tests/test015.py
http://pyjamas.googlecode.com/ · Python · 18 lines · 16 code · 2 blank · 0 comment · 5 complexity · 9fcc94348109983c688f7d6b85af0c23 MD5 · raw file
- 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