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

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

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

revision 981 by torben, Sat Jul 10 16:03:10 2010 UTC revision 1053 by torben, Tue Sep 14 16:00:57 2010 UTC
# Line 9  import dk.thoerup.traininfo.DepartureEnt Line 9  import dk.thoerup.traininfo.DepartureEnt
9  import dk.thoerup.traininfo.StationBean;  import dk.thoerup.traininfo.StationBean;
10  import dk.thoerup.traininfo.TimetableBean;  import dk.thoerup.traininfo.TimetableBean;
11    
12  public class DebugProvider implements DepartureProvider, StationProvider, TimetableProvider {  public class DebugProvider implements DepartureProvider, StationProvider, TimetableProvider, MetroProvider {
13    
         @Override  
         public boolean lookupDepartures(int station, boolean arrival) {  
                 return true;  
         }        
14                    
15          @Override          @Override
16          public DepartureBean getDepartures(int station, boolean arrival) {          public DepartureBean lookupDepartures(int station, boolean arrival) {
17                  DepartureBean bean = new DepartureBean();                  DepartureBean bean = new DepartureBean();
18                                    
19                  DepartureEntry departure = new DepartureEntry();                  DepartureEntry departure = new DepartureEntry();
# Line 54  public class DebugProvider implements De Line 50  public class DebugProvider implements De
50                  return bean;                  return bean;
51          }          }
52    
53          @Override          
54          public List<StationBean> getStations() {          public List<StationBean> getStations() {
55                  List<StationBean> stations = new ArrayList<StationBean>();                  List<StationBean> stations = new ArrayList<StationBean>();
56                                    
# Line 83  public class DebugProvider implements De Line 79  public class DebugProvider implements De
79                  station.setLatitude(52.0);                  station.setLatitude(52.0);
80                  station.setLongitude(11.0);                  station.setLongitude(11.0);
81                  station.setRegional(true);                  station.setRegional(true);
82                    station.setMetro(true);
83                  stations.add(station);                  stations.add(station);
84                                    
85                  return stations;                  return stations;
86          }          }
87    
88          @Override          @Override
89          public boolean lookupStations(Location location) {          public List<StationBean> lookupStations(Location location) {
90                  return true;                  return getStations();
91          }          }
92                    
93          @Override          @Override
94          public boolean lookupStationsByName(String name) {          public List<StationBean> lookupStationsByName(String name) {
95                  return true;                  return getStations();
96          }          }
97                    
98                    
99    
100          @Override          @Override
101          public boolean lookupStationsByIds(String ids) {          public List<StationBean> lookupStationsByIds(String ids) {
102                  return true;                  return getStations();
103          }          }
104    
105          @Override          @Override
106          public List<TimetableBean> getTimetable(String type, String trainID) {          public List<TimetableBean> lookupTimetable(String type, String trainID) {
107                  List<TimetableBean> timetables = new ArrayList<TimetableBean>();                  List<TimetableBean> timetables = new ArrayList<TimetableBean>();
108                                    
109                  TimetableBean timetable = new TimetableBean();                  TimetableBean timetable = new TimetableBean();
# Line 140  public class DebugProvider implements De Line 137  public class DebugProvider implements De
137                  return timetables;                  return timetables;
138          }          }
139    
140    
141          @Override          @Override
142          public boolean lookupTimetable(String type, String trainID) {          public MetroBean lookupMetroInfo(int stationID) {
143                  return true;                  MetroBean metro = new MetroBean();
144                    
145                    metro.operationInfo = "Metroen kører normalt og uden forsinkelser.";
146                    metro.plan = "Dag-/aftendrift. Metroen kører hvert 3. minut mellem Vanløse og Christianshavn - og hvert 6. minut til og fra Vestamager og Lufthavnen.";
147                    
148                    MetroEntry ent = new MetroEntry();
149                    ent.metro = "M1M2";
150                    ent.destination = "Mod Vanløse";
151                    ent.minutes = "0,5 2 3";
152                    metro.entries.add(ent);
153                    
154                    ent = new MetroEntry();
155                    ent.metro = "M1";
156                    ent.destination = "Mod Vestamager";
157                    ent.minutes = "0,5 6";
158                    metro.entries.add(ent);
159                    
160                    ent = new MetroEntry();
161                    ent.metro = "M2";
162                    ent.destination = "Mod Lufthavnen";
163                    ent.minutes = "3";
164                    metro.entries.add(ent);
165                    
166                    return metro;
167          }          }
168    
169    
170  }  }

Legend:
Removed from v.981  
changed lines
  Added in v.1053

  ViewVC Help
Powered by ViewVC 1.1.20