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

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/LocateStations.java

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

revision 1556 by torben, Mon Apr 4 10:56:44 2011 UTC revision 1557 by torben, Fri Jul 8 12:47:02 2011 UTC
# Line 49  public class LocateStations extends Http Line 49  public class LocateStations extends Http
49    
50          protected StationBean getStations(HttpServletRequest req) throws SQLException {          protected StationBean getStations(HttpServletRequest req) throws SQLException {
51                  StationBean stations = null;                  StationBean stations = null;
52                    
53                    boolean dummy = req.getParameter("dummy") != null;
54                    if (dummy == true)
55                            stations = new StationBean();
56                    
57                  if (req.getParameter("latitude") != null && req.getParameter("latitude") != null) {                  if (req.getParameter("latitude") != null && req.getParameter("latitude") != null) {
58                                                    
59                          Statistics.getInstance().incrementStationLookupsLocation();                          Statistics.getInstance().incrementStationLookupsLocation();
60                                                    
61                          double latitude = Double.parseDouble( req.getParameter("latitude") );                          double latitude = Double.parseDouble( req.getParameter("latitude") );
62                          double longitude = Double.parseDouble( req.getParameter("longitude") );                          double longitude = Double.parseDouble( req.getParameter("longitude") );
63                          stations = stationDao.getByLocation(latitude, longitude);                          if (dummy == false)
64                                    stations = stationDao.getByLocation(latitude, longitude);
65    
66                  } else if (req.getParameter("name") != null) {                  } else if (req.getParameter("name") != null) {
67                          Statistics.getInstance().incrementStationLookupsName();                          Statistics.getInstance().incrementStationLookupsName();
68                          String name = req.getParameter("name").trim();                          String name = req.getParameter("name").trim();
69                          stations = stationDao.getByName(name);                          if (dummy == false)
70                                    stations = stationDao.getByName(name);
71    
72                  } else if (req.getParameter("list") != null) {                  } else if (req.getParameter("list") != null) {
73                          Statistics.getInstance().incrementStationLookupsFavorites();                          Statistics.getInstance().incrementStationLookupsFavorites();
74                          String list = transformToIntList( req.getParameter("list"));                          String list = transformToIntList( req.getParameter("list"));
75                          stations = stationDao.getByList(list);                          if (dummy == false)
76                                    stations = stationDao.getByList(list);
77                  } else if (req.getParameter("dump") != null) {                  } else if (req.getParameter("dump") != null) {
78                          stations = stationDao.dumpAll();                          stations = stationDao.dumpAll();
79                  }                  }

Legend:
Removed from v.1556  
changed lines
  Added in v.1557

  ViewVC Help
Powered by ViewVC 1.1.20