PageRenderTime 144ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/pyjs/tests/test015.js

http://pyjamas.googlecode.com/
JavaScript | 26 lines | 26 code | 0 blank | 0 comment | 7 complexity | c09b88b2a5bd6c413134a5a4cb809584 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. __TimeSlot.prototype.__class__ = "TimeSlot";
  2. function TimeSlot(dayOfWeek, startMinutes, endMinutes) {
  3. return new __TimeSlot(dayOfWeek, startMinutes, endMinutes);
  4. }
  5. function __TimeSlot(dayOfWeek, startMinutes, endMinutes) {
  6. this.dayOfWeek = dayOfWeek;
  7. this.startMinutes = startMinutes;
  8. this.endMinutes = endMinutes;
  9. }
  10. __TimeSlot.prototype.compareTo = function(other) {
  11. if ((this.dayOfWeek < other.dayOfWeek)) {
  12. return -1;
  13. }
  14. else if ((this.dayOfWeek > other.dayOfWeek)) {
  15. return 1;
  16. }
  17. else {
  18. if ((this.startMinutes < other.startMinutes)) {
  19. return -1;
  20. }
  21. else if ((this.startMinutes > other.startMinutes)) {
  22. return 1;
  23. }
  24. }
  25. return 0;
  26. };