/[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 305 by torben, Thu Sep 10 09:40:27 2009 UTC revision 308 by torben, Thu Sep 10 18:13:52 2009 UTC
# Line 1  Line 1 
1  package dk.thoerup.traininfoservice.banedk;  package dk.thoerup.traininfoservice.banedk;
2    
3  public class DepartureBean {  public class DepartureBean implements Comparable<DepartureBean> {
4          private String time;              private String time;    
5          private int updated;              private int updated;    
6          private String trainNumber;          private String trainNumber;
# Line 60  public class DepartureBean { Line 60  public class DepartureBean {
60                  this.note = note;                  this.note = note;
61          }          }
62                    
63            @Override
64            public int compareTo(DepartureBean otherBean) {
65                    
66                    int time1 = Integer.parseInt(time.replace(":", ""));
67                    int time2 = Integer.parseInt(otherBean.time.replace(":", ""));
68                    if (time1 > time2)
69                            return 1;
70                    else
71                            return -1;
72                    
73            }
74            
75                    
76  }  }

Legend:
Removed from v.305  
changed lines
  Added in v.308

  ViewVC Help
Powered by ViewVC 1.1.20