/[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 362 by torben, Fri Sep 11 12:24:53 2009 UTC revision 363 by torben, Wed Sep 30 06:01:39 2009 UTC
# Line 3  package dk.thoerup.traininfo.provider; Line 3  package dk.thoerup.traininfo.provider;
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) {
# Line 42  public class DebugProvider implements De Line 46  public class DebugProvider implements De
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                                    
# Line 50  public class DebugProvider implements De Line 54  public class DebugProvider implements De
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                    
68                    stations.add(station);
69                    
70                    return stations;
71            }
72    
73            @Override
74            public boolean lookupStations(Location location) {
75                    return true;
76            }
77    
78            @Override
79            public List<TimetableBean> getTimetable() {
80                    List<TimetableBean> timetables = new ArrayList<TimetableBean>();
81                    
82                    TimetableBean timetable = new TimetableBean();
83                    timetable.setStation("Andeby");
84                    timetable.setArrival("");
85                    timetable.setDeparture("05:17");
86                    timetable.setCurrent(false);
87                    timetables.add(timetable);
88                    
89                    timetable = new TimetableBean();
90                    timetable.setStation("GÃ¥serød");
91                    timetable.setArrival("07:45");
92                    timetable.setDeparture("07:46");
93                    timetable.setCurrent(false);
94                    timetables.add(timetable);
95    
96                    timetable = new TimetableBean();
97                    timetable.setStation("Smallville");
98                    timetable.setArrival("08:32");
99                    timetable.setDeparture("08:32");
100                    timetable.setCurrent(true);
101                    timetables.add(timetable);
102    
103                    timetable = new TimetableBean();
104                    timetable.setStation("Pløresødal lejren");
105                    timetable.setArrival("09:02");
106                    timetable.setDeparture("");
107                    timetable.setCurrent(false);
108                    timetables.add(timetable);
109                    
110                    return timetables;
111            }
112    
113            @Override
114            public boolean lookupTimetable(String trainID) {
115                    return true;
116            }
117    
118  }  }

Legend:
Removed from v.362  
changed lines
  Added in v.363

  ViewVC Help
Powered by ViewVC 1.1.20