3 |
import java.util.ArrayList; |
import java.util.ArrayList; |
4 |
import java.util.List; |
import java.util.List; |
5 |
|
|
6 |
|
import android.location.Location; |
7 |
|
|
8 |
import dk.thoerup.traininfo.DepartureBean; |
import dk.thoerup.traininfo.DepartureBean; |
9 |
|
import dk.thoerup.traininfo.StationBean; |
10 |
|
import dk.thoerup.traininfo.TimetableBean; |
11 |
|
|
12 |
public class DebugProvider implements DepartureProvider { |
public class DebugProvider implements DepartureProvider, StationProvider, TimetableProvider { |
13 |
|
|
14 |
@Override |
@Override |
15 |
public boolean lookupDepartures(int station) { |
public boolean lookupDepartures(int station) { |
46 |
departure.setLocation("Hald"); |
departure.setLocation("Hald"); |
47 |
departure.setLastUpdate("2"); |
departure.setLastUpdate("2"); |
48 |
departure.setTrainNumber("IC-7"); |
departure.setTrainNumber("IC-7"); |
49 |
departure.setNote("Kun stĺpladser"); |
departure.setNote("Kun st�pladser"); |
50 |
list.add(departure); |
list.add(departure); |
51 |
|
|
52 |
|
|
54 |
return list; |
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 |
|
stations.add(station); |
68 |
|
|
69 |
|
station = new StationBean(); |
70 |
|
station.setName("Gåserød"); |
71 |
|
station.setDistance(5300); |
72 |
|
station.setId(2); |
73 |
|
station.setLatitude(58.0); |
74 |
|
station.setLongitude(10.0); |
75 |
|
stations.add(station); |
76 |
|
|
77 |
|
station = new StationBean(); |
78 |
|
station.setName("Pladerballe"); |
79 |
|
station.setDistance(15600); |
80 |
|
station.setId(3); |
81 |
|
station.setLatitude(52.0); |
82 |
|
station.setLongitude(11.0); |
83 |
|
stations.add(station); |
84 |
|
|
85 |
|
return stations; |
86 |
|
} |
87 |
|
|
88 |
|
@Override |
89 |
|
public boolean lookupStations(Location location) { |
90 |
|
return true; |
91 |
|
} |
92 |
|
|
93 |
|
@Override |
94 |
|
public boolean lookupStationsByName(String name) { |
95 |
|
return true; |
96 |
|
} |
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
@Override |
101 |
|
public boolean lookupStationsByIds(String ids) { |
102 |
|
return true; |
103 |
|
} |
104 |
|
|
105 |
|
@Override |
106 |
|
public List<TimetableBean> getTimetable(String type, String trainID) { |
107 |
|
List<TimetableBean> timetables = new ArrayList<TimetableBean>(); |
108 |
|
|
109 |
|
TimetableBean timetable = new TimetableBean(); |
110 |
|
timetable.setStation("Andeby"); |
111 |
|
timetable.setArrival(""); |
112 |
|
timetable.setDeparture("05:17"); |
113 |
|
timetable.setCurrent(false); |
114 |
|
timetables.add(timetable); |
115 |
|
|
116 |
|
timetable = new TimetableBean(); |
117 |
|
timetable.setStation("Gåserød"); |
118 |
|
timetable.setArrival("07:45"); |
119 |
|
timetable.setDeparture("07:46"); |
120 |
|
timetable.setCurrent(false); |
121 |
|
timetables.add(timetable); |
122 |
|
|
123 |
|
timetable = new TimetableBean(); |
124 |
|
timetable.setStation("Smallville"); |
125 |
|
timetable.setArrival("08:32"); |
126 |
|
timetable.setDeparture("08:32"); |
127 |
|
timetable.setCurrent(true); |
128 |
|
timetables.add(timetable); |
129 |
|
|
130 |
|
timetable = new TimetableBean(); |
131 |
|
timetable.setStation("Pløresødal lejren"); |
132 |
|
timetable.setArrival("09:02"); |
133 |
|
timetable.setDeparture(""); |
134 |
|
timetable.setCurrent(false); |
135 |
|
timetables.add(timetable); |
136 |
|
|
137 |
|
return timetables; |
138 |
|
} |
139 |
|
|
140 |
|
@Override |
141 |
|
public boolean lookupTimetable(String type, String trainID) { |
142 |
|
return true; |
143 |
|
} |
144 |
|
|
145 |
} |
} |