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

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

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

revision 1906 by torben, Fri Jan 4 10:37:36 2013 UTC revision 1907 by torben, Fri Jan 4 10:53:49 2013 UTC
# Line 87  public class CompareStations extends Htt Line 87  public class CompareStations extends Htt
87                                          }                                          }
88                                  }                                  }
89                          }                          }
90                            
91                            StationBean bean = dao.dumpAll();
92                            
93                            ////////////////////////////////
94                            sb.append("<h2>Duplicate ID's in DB</h2>\n");
95                            sb.append("<ul>");                      
96                            Map<String,String> stationIDS = new TreeMap<String,String>();
97                            for (StationEntry station : bean.entries) {
98                                    if (station.isRegional()) {
99                                            String id = station.getRegional();
100                                            String oldstation = stationIDS.get(id);
101                                            if (oldstation == null) {
102                                                    stationIDS.put(id, station.getName());
103                                            } else {
104                                                    sb.append("<li> Duplicate found on key=" + id + " old station=" + oldstation + " current=" + station.getName());
105                                            }
106                                    }
107                                    if (station.isStrain()) {
108                                            String id = station.getStrain();
109                                            String oldstation= stationIDS.get(id);
110                                            if (oldstation == null) {
111                                                    stationIDS.put(id, station.getName());
112                                            } else {
113                                                    sb.append("<li> Duplicate found on key=" + id + " old station=" + oldstation + " current=" + station.getName());
114                                            }
115                                    }
116                            }                      
117                            sb.append("</ul>");
118                            
119                            ////////////////////////////////                        
120    
121                          sb.append("<h2>Active stations in DB</h2>\n");                          sb.append("<h2>Active stations in DB</h2>\n");
122                          sb.append("<ul>");                          sb.append("<ul>");
123    
124                          StationBean bean = dao.dumpAll();                          
125                          for (StationEntry station : bean.entries) {                                                      for (StationEntry station : bean.entries) {                            
126                                  if (station.isRegional() || station.isStrain()) {                                  if (station.isRegional() || station.isStrain()) {
127                                          String href = banedkStations.get(station.getName() );                                          String href = banedkStations.get(station.getName() );

Legend:
Removed from v.1906  
changed lines
  Added in v.1907

  ViewVC Help
Powered by ViewVC 1.1.20