/[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 1405 by torben, Thu Apr 21 05:51:25 2011 UTC revision 1406 by torben, Mon May 2 09:34:53 2011 UTC
# Line 81  public class TimetableFetcher { Line 81  public class TimetableFetcher {
81    
82                  return id;                  return id;
83          }          }
84            
85            String correctStationName(String name) {
86                    if (name.equals("København"))
87                            name = "København H"; //correct inconsistency in naming
88                    
89                    return name;            
90            }
91    
92          TimetableBean lookupTimetableAzureSite(String trainID, String type) throws Exception {                    TimetableBean lookupTimetableAzureSite(String trainID, String type) throws Exception {          
93                  TimetableBean timetableBean = new TimetableBean();                  TimetableBean timetableBean = new TimetableBean();
# Line 120  public class TimetableFetcher { Line 127  public class TimetableFetcher {
127                                                    
128                          TimetableEntry entry = new TimetableEntry();                          TimetableEntry entry = new TimetableEntry();
129                                                    
130                          String station = fields.get(0).text() ;                          String station = correctStationName( fields.get(0).text() );
                         if (station.equals("København"))  
                                 station = "København H"; //correct inconsistency in naming  
131                                                    
132                          entry.setStation( station );                          entry.setStation( station );
133                          entry.setArrival( fields.get(1).text() );                          entry.setArrival( fields.get(1).text() );
# Line 201  public class TimetableFetcher { Line 206  public class TimetableFetcher {
206                  TimetableEntry entry = new TimetableEntry();                  TimetableEntry entry = new TimetableEntry();
207    
208                  String station = DepartureFetcher.cleanText( parts[0] ) ;                  String station = DepartureFetcher.cleanText( parts[0] ) ;
209                  if (station.equals("København"))                  station = correctStationName(station);
210                          station = "København H"; //correct inconsistency in naming  
211    
212                  String arrival = DepartureFetcher.cleanText( parts[1] );                  String arrival = DepartureFetcher.cleanText( parts[1] );
213                  String departure = DepartureFetcher.cleanText( "" );                  String departure = DepartureFetcher.cleanText( "" );
# Line 262  public class TimetableFetcher { Line 267  public class TimetableFetcher {
267                          TimetableEntry entry = new TimetableEntry();                          TimetableEntry entry = new TimetableEntry();
268                                                    
269                          String station = DepartureFetcher.cleanText( fields.get(0).text() ) ;                          String station = DepartureFetcher.cleanText( fields.get(0).text() ) ;
270                          if (station.equals("København"))                          station = correctStationName(station);
271                                  station = "København H"; //correct inconsistency in naming  
272                                                    
273                          String arrival = DepartureFetcher.cleanText( fields.get(1).text() );                          String arrival = DepartureFetcher.cleanText( fields.get(1).text() );
274                          String departure = DepartureFetcher.cleanText( fields.get(2).text() );                          String departure = DepartureFetcher.cleanText( fields.get(2).text() );

Legend:
Removed from v.1405  
changed lines
  Added in v.1406

  ViewVC Help
Powered by ViewVC 1.1.20