private ArrivalTimes emptyArrival(Integer busStopNumber, BusLine busLine) { ArrivalTimes arrivalTimes = new ArrivalTimes(); arrivalTimes.setBusStopNumber(busStopNumber); arrivalTimes.setBusLineName(busLine.getName()); arrivalTimes.setLoading(true); return arrivalTimes; }
@Override public void run() { try { List<BusLine> linesFromStop = getLinesFromStop(busStopNumber); for (ArrivalTimes emptyArrival : emptyArrivalTimes(busStopNumber, linesFromStop)) { notifyLoaded(emptyArrival); } for (BusLine busLine : linesFromStop) { String name = busLine.getName(); ArrivalTimes arrivalsForLine = getArrivals(busStopNumber, name); notifyLoaded(arrivalsForLine); } notifyCompleted(); } catch (SevibusException error) { notifyError(error); } }