/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/provider/XmlDepartureProvider.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/provider/XmlDepartureProvider.java

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

revision 1248 by torben, Mon Oct 4 08:42:12 2010 UTC revision 1249 by torben, Thu Mar 31 17:39:20 2011 UTC
# Line 22  public class XmlDepartureProvider implem Line 22  public class XmlDepartureProvider implem
22                                    
23                    
24          @Override          @Override
25          public DepartureBean lookupDepartures(int stationID, boolean arrival) {                  public DepartureBean lookupDepartures(int stationID, boolean arrival,String type) {            
26                                    
27                  String key = "" + stationID + ":" + arrival;                  String key = "" + stationID + ":" + arrival + ":" + type;
28                                    
29                  DepartureBean departures = departureCache.get(key);                  DepartureBean departures = departureCache.get(key);
30                    
31                  if (departures == null) {                                        if (departures == null) {                      
32                          departures = lookupDeparturesWorker(stationID, arrival);                          departures = lookupDeparturesWorker(stationID, arrival, type);
33                                                    
34                          if (departures != null) {                                                if (departures != null) {                      
35                                  departureCache.put(key, departures);                                  departureCache.put(key, departures);
# Line 42  public class XmlDepartureProvider implem Line 42  public class XmlDepartureProvider implem
42                  return departures;                  return departures;
43          }          }
44                    
45          private DepartureBean lookupDeparturesWorker(int stationID, boolean arrival) {          private DepartureBean lookupDeparturesWorker(int stationID, boolean arrival, String type) {
46    
47                  try                  try
48                  {                        {      
49                          int iArrival = arrival ? 1 : 0;                          int iArrival = arrival ? 1 : 0;
50                          String url = XmlUtil.SERVICE_BASE + "/DepartureServlet?format=xml&station=" + stationID + "&arrival=" + iArrival;                          String url = XmlUtil.SERVICE_BASE + "/DepartureServlet?format=xml&station=" + stationID + "&arrival=" + iArrival + "&type=" + type;
51                          Log.i("xmlurl",url);                          Log.i("xmlurl",url);
52                          String doc =  DownloadUtil.getContentString(url, 30000, "ISO-8859-1");                          String doc =  DownloadUtil.getContentString(url, 30000, "ISO-8859-1");
53    

Legend:
Removed from v.1248  
changed lines
  Added in v.1249

  ViewVC Help
Powered by ViewVC 1.1.20