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

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

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

revision 1416 by torben, Mon May 2 12:21:49 2011 UTC revision 1417 by torben, Mon May 2 16:21:37 2011 UTC
# Line 67  public class TimetableFetcher { Line 67  public class TimetableFetcher {
67                  }                  }
68          }          }
69                    
70          StationEntry getStationId(String name) {          StationEntry getStation(String name) {
71                  StationEntry station = stationCache.get(name);                  StationEntry station = stationCache.get(name);
72                                    
73                  if (station == null) {                  if (station == null) {
74                          try {                          try {
75                                  StationBean bean = stationDao.getByName(name);                                  station = stationDao.getSimpleByName(name);
76                                  if (bean.entries.size() == 1) {                                  if (station != null) {
                                         station = bean.entries.get(0);  
77                                          stationCache.put(name,station);                                          stationCache.put(name,station);
78                                  }                                  }
79                          } catch (SQLException e) {                          } catch (SQLException e) {
# Line 144  public class TimetableFetcher { Line 143  public class TimetableFetcher {
143                                  currentStationSaved = true;                                  currentStationSaved = true;
144                          }                          }
145                                                    
146                          entry.setStationEntry( getStationId( station ));                          entry.setStationEntry( getStation( station ));
147                                                    
148                          timetableBean.entries.add(entry);                          timetableBean.entries.add(entry);
149                  }                  }
# Line 220  public class TimetableFetcher { Line 219  public class TimetableFetcher {
219                  entry.setDeparture( departure );                  entry.setDeparture( departure );
220    
221    
222                  entry.setStationEntry( getStationId( station ));                  entry.setStationEntry( getStation( station ));
223    
224                  timetableBean.entries.add(entry);                  timetableBean.entries.add(entry);
225              }                        }          
# Line 286  public class TimetableFetcher { Line 285  public class TimetableFetcher {
285                                  currentStationSaved = true;                                  currentStationSaved = true;
286                          }                          }
287                                                    
288                          entry.setStationEntry( getStationId( station ));                          entry.setStationEntry( getStation( station ));
289                                                    
290                          timetableBean.entries.add(entry);                          timetableBean.entries.add(entry);
291                  }                                }              

Legend:
Removed from v.1416  
changed lines
  Added in v.1417

  ViewVC Help
Powered by ViewVC 1.1.20