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

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

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

revision 1042 by torben, Mon Sep 13 17:57:31 2010 UTC revision 1043 by torben, Mon Sep 13 18:53:30 2010 UTC
# Line 39  public class MetroFetcher { Line 39  public class MetroFetcher {
39          Logger logger = Logger.getLogger(MetroFetcher.class.getName());          Logger logger = Logger.getLogger(MetroFetcher.class.getName());
40          StationDAO stationDAO = new StationDAO();          StationDAO stationDAO = new StationDAO();
41                    
42          Map<String, MetroBean> cache = new TimeoutMap<String,MetroBean>(1000);          Map<String, MetroBean> cache = new TimeoutMap<String,MetroBean>(60000); //TODO: make metro cache timeout configurable
43                    
44          public MetroBean cachedLookupMetroDepartures(int stationID) throws Exception {          public MetroBean cachedLookupMetroDepartures(int stationID) throws Exception {
45                  final String key = "metro:" + stationID;                  final String key = "metro:" + stationID;
# Line 100  public class MetroFetcher { Line 100  public class MetroFetcher {
100                          bean.entries.add(entry);                                                  bean.entries.add(entry);                        
101                  }                  }
102                                                                    
103                  bean.operationInfo = contentElems.get(3).text();                                  bean.operationInfo = contentElems.get(3).text();
104                  bean.plan = contentElems.get(5).text();                  
105                    int planIndex;
106                    if (contentElems.get(4).text().trim().equalsIgnoreCase("stationsinformation")) {
107                            planIndex = 7;
108                    } else {
109                            planIndex = 5;
110                    }
111                            
112                    bean.plan = contentElems.get(planIndex).text();
113                                    
114                  return bean;                  return bean;
115          }          }

Legend:
Removed from v.1042  
changed lines
  Added in v.1043

  ViewVC Help
Powered by ViewVC 1.1.20