1 |
package dk.thoerup.traininfo.provider;
|
2 |
|
3 |
import java.util.ArrayList;
|
4 |
import java.util.List;
|
5 |
|
6 |
import android.location.Location;
|
7 |
|
8 |
import dk.thoerup.traininfo.DepartureBean;
|
9 |
import dk.thoerup.traininfo.StationBean;
|
10 |
import dk.thoerup.traininfo.TimetableBean;
|
11 |
|
12 |
public class DebugProvider implements DepartureProvider, StationProvider, TimetableProvider {
|
13 |
|
14 |
@Override
|
15 |
public boolean lookupDepartures(int station) {
|
16 |
return true;
|
17 |
}
|
18 |
|
19 |
@Override
|
20 |
public List<DepartureBean> getDepartures(int station) {
|
21 |
List<DepartureBean> list = new ArrayList<DepartureBean>();
|
22 |
|
23 |
DepartureBean departure = new DepartureBean();
|
24 |
departure.setTime("08:03");
|
25 |
departure.setDestination("Dar-es Salaam");
|
26 |
departure.setOrigin("Sao Paulo");
|
27 |
departure.setLocation("Beijing");
|
28 |
departure.setLastUpdate("1");
|
29 |
departure.setTrainNumber("RA-123");
|
30 |
list.add(departure);
|
31 |
|
32 |
departure = new DepartureBean();
|
33 |
departure.setTime("13:39");
|
34 |
departure.setDestination("Timbuktu");
|
35 |
departure.setOrigin("Anchorage");
|
36 |
departure.setLocation("Helsinki");
|
37 |
departure.setLastUpdate("2");
|
38 |
departure.setTrainNumber("IC-7");
|
39 |
departure.setStatus("2 days delayed");
|
40 |
list.add(departure);
|
41 |
|
42 |
departure = new DepartureBean();
|
43 |
departure.setTime("21:41");
|
44 |
departure.setDestination("Skive");
|
45 |
departure.setOrigin("Virksund");
|
46 |
departure.setLocation("Hald");
|
47 |
departure.setLastUpdate("2");
|
48 |
departure.setTrainNumber("IC-7");
|
49 |
departure.setNote("Kun st�pladser");
|
50 |
list.add(departure);
|
51 |
|
52 |
|
53 |
|
54 |
return list;
|
55 |
}
|
56 |
|
57 |
@Override
|
58 |
public List<StationBean> getStations() {
|
59 |
List<StationBean> stations = new ArrayList<StationBean>();
|
60 |
|
61 |
StationBean station = new StationBean();
|
62 |
station.setName("Andeby");
|
63 |
station.setDistance(1700);
|
64 |
station.setId(1);
|
65 |
station.setLatitude(56.0);
|
66 |
station.setLongitude(10.0);
|
67 |
station.setRegional(true);
|
68 |
stations.add(station);
|
69 |
|
70 |
station = new StationBean();
|
71 |
station.setName("Gåserød");
|
72 |
station.setDistance(5300);
|
73 |
station.setId(2);
|
74 |
station.setLatitude(58.0);
|
75 |
station.setLongitude(10.0);
|
76 |
station.setRegional(true);
|
77 |
stations.add(station);
|
78 |
|
79 |
station = new StationBean();
|
80 |
station.setName("Pladerballe");
|
81 |
station.setDistance(15600);
|
82 |
station.setId(3);
|
83 |
station.setLatitude(52.0);
|
84 |
station.setLongitude(11.0);
|
85 |
station.setRegional(true);
|
86 |
stations.add(station);
|
87 |
|
88 |
return stations;
|
89 |
}
|
90 |
|
91 |
@Override
|
92 |
public boolean lookupStations(Location location) {
|
93 |
return true;
|
94 |
}
|
95 |
|
96 |
@Override
|
97 |
public boolean lookupStationsByName(String name) {
|
98 |
return true;
|
99 |
}
|
100 |
|
101 |
|
102 |
|
103 |
@Override
|
104 |
public boolean lookupStationsByIds(String ids) {
|
105 |
return true;
|
106 |
}
|
107 |
|
108 |
@Override
|
109 |
public List<TimetableBean> getTimetable(String type, String trainID) {
|
110 |
List<TimetableBean> timetables = new ArrayList<TimetableBean>();
|
111 |
|
112 |
TimetableBean timetable = new TimetableBean();
|
113 |
timetable.setStation("Andeby");
|
114 |
timetable.setArrival("");
|
115 |
timetable.setDeparture("05:17");
|
116 |
timetable.setCurrent(false);
|
117 |
timetables.add(timetable);
|
118 |
|
119 |
timetable = new TimetableBean();
|
120 |
timetable.setStation("Gåserød");
|
121 |
timetable.setArrival("07:45");
|
122 |
timetable.setDeparture("07:46");
|
123 |
timetable.setCurrent(false);
|
124 |
timetables.add(timetable);
|
125 |
|
126 |
timetable = new TimetableBean();
|
127 |
timetable.setStation("Smallville");
|
128 |
timetable.setArrival("08:32");
|
129 |
timetable.setDeparture("08:32");
|
130 |
timetable.setCurrent(true);
|
131 |
timetables.add(timetable);
|
132 |
|
133 |
timetable = new TimetableBean();
|
134 |
timetable.setStation("Pløresødal lejren");
|
135 |
timetable.setArrival("09:02");
|
136 |
timetable.setDeparture("");
|
137 |
timetable.setCurrent(false);
|
138 |
timetables.add(timetable);
|
139 |
|
140 |
return timetables;
|
141 |
}
|
142 |
|
143 |
@Override
|
144 |
public boolean lookupTimetable(String type, String trainID) {
|
145 |
return true;
|
146 |
}
|
147 |
|
148 |
}
|