/[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 307 by torben, Thu Sep 10 18:11:53 2009 UTC revision 312 by torben, Fri Sep 11 05:32:04 2009 UTC
# Line 1  Line 1 
1  package dk.thoerup.traininfoservice.banedk;  package dk.thoerup.traininfoservice.banedk;
2    
3  public class DepartureBean implements Comparable {  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 61  public class DepartureBean implements Co Line 61  public class DepartureBean implements Co
61          }          }
62                    
63          @Override          @Override
64          public int compareTo(Object arg0) {          public int compareTo(DepartureBean otherBean) {
                 DepartureBean otherBean = (DepartureBean) arg0;  
65                                    
66                  int time1 = Integer.parseInt(time.replace(":", ""));                  int time1 = Integer.parseInt(time.replace(":", ""));
67                  int time2 = Integer.parseInt(otherBean.time.replace(":", ""));                  int time2 = Integer.parseInt(otherBean.time.replace(":", ""));
# Line 73  public class DepartureBean implements Co Line 72  public class DepartureBean implements Co
72                                    
73          }          }
74                    
75            public String getUpdatedString() {
76                    String updStr;
77                    
78                    switch (updated) {
79                    case 1:
80                            updStr = "&lt; 3 min";
81                            break;
82                    case 2:
83                            updStr = "< 3 min";
84                            break;
85                    case 3:
86                            updStr = "&gt; 10 min";
87                            break;
88                    case 4:
89                            updStr = "No info";
90                            break;
91                    default:
92                            updStr = "Unknown:" + updated;                  
93                    }
94                    
95                    return updStr;
96            }
97                    
98  }  }

Legend:
Removed from v.307  
changed lines
  Added in v.312

  ViewVC Help
Powered by ViewVC 1.1.20