/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureBean.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureBean.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 372 by torben, Sun Sep 13 20:17:32 2009 UTC revision 373 by torben, Wed Sep 30 19:49:25 2009 UTC
# Line 62  public class DepartureBean implements Co Line 62  public class DepartureBean implements Co
62                    
63          @Override          @Override
64          public int compareTo(DepartureBean otherBean) {          public int compareTo(DepartureBean otherBean) {
65                    String timeStr1 = time.replace(":","").trim();
66                    String timeStr2 = otherBean.time.replace(":","").trim();
67                                    
68                  int time1 = Integer.parseInt(time.replace(":", ""));                  int time1 = 0;
69                  int time2 = Integer.parseInt(otherBean.time.replace(":", ""));                  int time2 = 0;
70                    
71                    if (timeStr1.length() > 0)
72                            time1 = Integer.parseInt(timeStr1);
73                    
74                    if (timeStr2.length() > 0)
75                            time2 = Integer.parseInt(timeStr2);
76                                    
77                  //work correctly when clock wraps around at midnight                  //work correctly when clock wraps around at midnight
78                  if (Math.abs(time1-time2) < 1200) {                  if (Math.abs(time1-time2) < 1200) {

Legend:
Removed from v.372  
changed lines
  Added in v.373

  ViewVC Help
Powered by ViewVC 1.1.20