4 |
import java.util.List; |
import java.util.List; |
5 |
|
|
6 |
import android.location.Location; |
import android.location.Location; |
|
|
|
7 |
import dk.thoerup.traininfo.DepartureBean; |
import dk.thoerup.traininfo.DepartureBean; |
8 |
|
import dk.thoerup.traininfo.DepartureEntry; |
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 List<DepartureBean> getDepartures(int station, boolean arrival) { |
public DepartureBean lookupDepartures(int station, boolean arrival) { |
17 |
List<DepartureBean> list = new ArrayList<DepartureBean>(); |
DepartureBean bean = new DepartureBean(); |
18 |
|
|
19 |
DepartureBean departure = new DepartureBean(); |
DepartureEntry departure = new DepartureEntry(); |
20 |
departure.setTime("08:03"); |
departure.setTime("08:03"); |
21 |
departure.setDestination("Dar-es Salaam"); |
departure.setDestination("Dar-es Salaam"); |
22 |
departure.setOrigin("Sao Paulo"); |
departure.setOrigin("Sao Paulo"); |
23 |
departure.setLocation("Beijing"); |
departure.setLocation("Beijing"); |
24 |
departure.setLastUpdate("1"); |
departure.setLastUpdate("1"); |
25 |
departure.setTrainNumber("RA-123"); |
departure.setTrainNumber("RA-123"); |
26 |
list.add(departure); |
bean.entries.add(departure); |
27 |
|
|
28 |
departure = new DepartureBean(); |
departure = new DepartureEntry(); |
29 |
departure.setTime("13:39"); |
departure.setTime("13:39"); |
30 |
departure.setDestination("Timbuktu"); |
departure.setDestination("Timbuktu"); |
31 |
departure.setOrigin("Anchorage"); |
departure.setOrigin("Anchorage"); |
33 |
departure.setLastUpdate("2"); |
departure.setLastUpdate("2"); |
34 |
departure.setTrainNumber("IC-7"); |
departure.setTrainNumber("IC-7"); |
35 |
departure.setStatus("2 days delayed"); |
departure.setStatus("2 days delayed"); |
36 |
list.add(departure); |
bean.entries.add(departure); |
37 |
|
|
38 |
departure = new DepartureBean(); |
departure = new DepartureEntry(); |
39 |
departure.setTime("21:41"); |
departure.setTime("21:41"); |
40 |
departure.setDestination("Skive"); |
departure.setDestination("Skive"); |
41 |
departure.setOrigin("Virksund"); |
departure.setOrigin("Virksund"); |
43 |
departure.setLastUpdate("2"); |
departure.setLastUpdate("2"); |
44 |
departure.setTrainNumber("IC-7"); |
departure.setTrainNumber("IC-7"); |
45 |
departure.setNote("Kun st�pladser"); |
departure.setNote("Kun st�pladser"); |
46 |
list.add(departure); |
bean.entries.add(departure); |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
return list; |
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 |
|
|
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(); |
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 |
} |
} |