1 |
package dk.thoerup.traininfoservice.banedk; |
package dk.thoerup.traininfoservice.banedk; |
2 |
|
|
3 |
public class DepartureBean { |
public class DepartureBean implements Comparable { |
4 |
private String time; |
private String time; |
5 |
private int updated; |
private int updated; |
6 |
private String trainNumber; |
private String trainNumber; |
60 |
this.note = note; |
this.note = note; |
61 |
} |
} |
62 |
|
|
63 |
|
@Override |
64 |
|
public int compareTo(Object arg0) { |
65 |
|
DepartureBean otherBean = (DepartureBean) arg0; |
66 |
|
|
67 |
|
int time1 = Integer.parseInt(time.replace(":", "")); |
68 |
|
int time2 = Integer.parseInt(otherBean.time.replace(":", "")); |
69 |
|
if (time1 > time2) |
70 |
|
return 1; |
71 |
|
else |
72 |
|
return -1; |
73 |
|
|
74 |
|
} |
75 |
|
|
76 |
|
|
77 |
} |
} |