use of org.onebusaway.transit_data.model.ArrivalAndDepartureBean in project onebusaway-application-modules by camsys.
the class StopWithArrivalsAndDeparturesBeanServiceImpl method getArrivalsAndDeparturesByStopId.
public StopWithArrivalsAndDeparturesBean getArrivalsAndDeparturesByStopId(AgencyAndId id, ArrivalsAndDeparturesQueryBean query) {
StopBean stop = _stopBeanService.getStopForId(id);
if (stop == null)
return null;
List<ArrivalAndDepartureBean> arrivalsAndDepartures = _arrivalsAndDeparturesBeanService.getArrivalsAndDeparturesByStopId(id, query);
List<AgencyAndId> nearbyStopIds = _nearbyStopsBeanService.getNearbyStops(stop, 100);
List<StopBean> nearbyStops = new ArrayList<StopBean>();
for (AgencyAndId nearbyStopId : nearbyStopIds) nearbyStops.add(_stopBeanService.getStopForId(nearbyStopId));
List<ServiceAlertBean> situations = _serviceAlertsBeanService.getServiceAlertsForStopId(query.getTime(), id);
return new StopWithArrivalsAndDeparturesBean(stop, arrivalsAndDepartures, nearbyStops, situations);
}
Aggregations