--- android/TrainInfo/src/dk/thoerup/traininfo/provider/DebugProvider.java 2009/08/08 19:02:20 237 +++ android/TrainInfo/src/dk/thoerup/traininfo/provider/DebugProvider.java 2010/05/03 12:39:34 700 @@ -3,20 +3,25 @@ import java.util.ArrayList; import java.util.List; +import android.location.Location; + import dk.thoerup.traininfo.DepartureBean; +import dk.thoerup.traininfo.StationBean; +import dk.thoerup.traininfo.TimetableBean; -public class DebugProvider implements DepartureProvider { +public class DebugProvider implements DepartureProvider, StationProvider, TimetableProvider { @Override - public void lookupDepartures(String station) { + public boolean lookupDepartures(int station) { + return true; } @Override - public List getDepartures() { + public List getDepartures(int station) { List list = new ArrayList(); DepartureBean departure = new DepartureBean(); - departure.setTime("17:03"); + departure.setTime("08:03"); departure.setDestination("Dar-es Salaam"); departure.setOrigin("Sao Paulo"); departure.setLocation("Beijing"); @@ -25,15 +30,119 @@ list.add(departure); departure = new DepartureBean(); - departure.setTime("23:39"); + departure.setTime("13:39"); departure.setDestination("Timbuktu"); departure.setOrigin("Anchorage"); departure.setLocation("Helsinki"); departure.setLastUpdate("2"); departure.setTrainNumber("IC-7"); + departure.setStatus("2 days delayed"); + list.add(departure); + + departure = new DepartureBean(); + departure.setTime("21:41"); + departure.setDestination("Skive"); + departure.setOrigin("Virksund"); + departure.setLocation("Hald"); + departure.setLastUpdate("2"); + departure.setTrainNumber("IC-7"); + departure.setNote("Kun st�pladser"); list.add(departure); + + return list; } + @Override + public List getStations() { + List stations = new ArrayList(); + + StationBean station = new StationBean(); + station.setName("Andeby"); + station.setDistance(1700); + station.setId(1); + station.setLatitude(56.0); + station.setLongitude(10.0); + station.setRegional(true); + stations.add(station); + + station = new StationBean(); + station.setName("Gåserød"); + station.setDistance(5300); + station.setId(2); + station.setLatitude(58.0); + station.setLongitude(10.0); + station.setRegional(true); + stations.add(station); + + station = new StationBean(); + station.setName("Pladerballe"); + station.setDistance(15600); + station.setId(3); + station.setLatitude(52.0); + station.setLongitude(11.0); + station.setRegional(true); + stations.add(station); + + return stations; + } + + @Override + public boolean lookupStations(Location location) { + return true; + } + + @Override + public boolean lookupStationsByName(String name) { + return true; + } + + + + @Override + public boolean lookupStationsByIds(String ids) { + return true; + } + + @Override + public List getTimetable(String type, String trainID) { + List timetables = new ArrayList(); + + TimetableBean timetable = new TimetableBean(); + timetable.setStation("Andeby"); + timetable.setArrival(""); + timetable.setDeparture("05:17"); + timetable.setCurrent(false); + timetables.add(timetable); + + timetable = new TimetableBean(); + timetable.setStation("Gåserød"); + timetable.setArrival("07:45"); + timetable.setDeparture("07:46"); + timetable.setCurrent(false); + timetables.add(timetable); + + timetable = new TimetableBean(); + timetable.setStation("Smallville"); + timetable.setArrival("08:32"); + timetable.setDeparture("08:32"); + timetable.setCurrent(true); + timetables.add(timetable); + + timetable = new TimetableBean(); + timetable.setStation("Pløresødal lejren"); + timetable.setArrival("09:02"); + timetable.setDeparture(""); + timetable.setCurrent(false); + timetables.add(timetable); + + return timetables; + } + + @Override + public boolean lookupTimetable(String type, String trainID) { + return true; + } + }