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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 319 - (hide annotations) (download)
Fri Sep 11 12:24:53 2009 UTC (14 years, 8 months ago) by torben
File size: 1397 byte(s)
Provider's : differentiate between an empty returned list or a communication error

Re-organize some of the background work
1 torben 237 package dk.thoerup.traininfo.provider;
2    
3     import java.util.ArrayList;
4     import java.util.List;
5    
6     import dk.thoerup.traininfo.DepartureBean;
7    
8     public class DebugProvider implements DepartureProvider {
9    
10     @Override
11 torben 319 public boolean lookupDepartures(int station) {
12     return true;
13 torben 237 }
14    
15     @Override
16 torben 319 public List<DepartureBean> getDepartures(int station) {
17 torben 237 List<DepartureBean> list = new ArrayList<DepartureBean>();
18    
19     DepartureBean departure = new DepartureBean();
20 torben 244 departure.setTime("08:03");
21 torben 237 departure.setDestination("Dar-es Salaam");
22     departure.setOrigin("Sao Paulo");
23     departure.setLocation("Beijing");
24     departure.setLastUpdate("1");
25     departure.setTrainNumber("RA-123");
26     list.add(departure);
27    
28     departure = new DepartureBean();
29 torben 244 departure.setTime("13:39");
30 torben 237 departure.setDestination("Timbuktu");
31     departure.setOrigin("Anchorage");
32     departure.setLocation("Helsinki");
33     departure.setLastUpdate("2");
34     departure.setTrainNumber("IC-7");
35 torben 244 departure.setStatus("2 days delayed");
36 torben 237 list.add(departure);
37 torben 244
38     departure = new DepartureBean();
39     departure.setTime("21:41");
40     departure.setDestination("Skive");
41     departure.setOrigin("Virksund");
42     departure.setLocation("Hald");
43     departure.setLastUpdate("2");
44     departure.setTrainNumber("IC-7");
45     departure.setNote("Kun ståpladser");
46     list.add(departure);
47 torben 237
48 torben 244
49    
50 torben 237 return list;
51     }
52    
53     }

  ViewVC Help
Powered by ViewVC 1.1.20