PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/pyjs/tests/test015.py

http://pyjamas.googlecode.com/
Python | 18 lines | 16 code | 2 blank | 0 comment | 2 complexity | 9fcc94348109983c688f7d6b85af0c23 MD5 | raw file
 1class TimeSlot:
 2
 3    def __init__(self, dayOfWeek, startMinutes, endMinutes):
 4        self.dayOfWeek = dayOfWeek
 5        self.startMinutes = startMinutes
 6        self.endMinutes = endMinutes
 7    
 8    def compareTo(self, other):
 9        if self.dayOfWeek < other.dayOfWeek:
10            return -1
11        elif self.dayOfWeek > other.dayOfWeek:
12            return 1
13        else:
14            if self.startMinutes < other.startMinutes:
15                return -1
16            elif self.startMinutes > other.startMinutes:
17                return 1
18        return 0