Search in sources :

Example 1 with AgencyAndRouteComparator

use of org.onebusaway.presentation.impl.AgencyAndRouteComparator in project onebusaway-application-modules by camsys.

the class RouteListServiceImpl method getRoutes.

@Override
public List<RouteBean> getRoutes() {
    List<RouteBean> allRoutes = new ArrayList<RouteBean>();
    List<AgencyWithCoverageBean> agencies = _transitDataService.getAgenciesWithCoverage();
    for (AgencyWithCoverageBean agency : agencies) {
        allRoutes.addAll(_transitDataService.getRoutesForAgencyId(agency.getAgency().getId()).getList());
    }
    Collections.sort(allRoutes, (getShowAgencyNames() ? new AgencyAndRouteComparator() : new RouteComparator()));
    return allRoutes;
}
Also used : AgencyAndRouteComparator(org.onebusaway.presentation.impl.AgencyAndRouteComparator) RouteBean(org.onebusaway.transit_data.model.RouteBean) AgencyWithCoverageBean(org.onebusaway.transit_data.model.AgencyWithCoverageBean) ArrayList(java.util.ArrayList) AgencyAndRouteComparator(org.onebusaway.presentation.impl.AgencyAndRouteComparator) RouteComparator(org.onebusaway.presentation.impl.RouteComparator)

Aggregations

ArrayList (java.util.ArrayList)1 AgencyAndRouteComparator (org.onebusaway.presentation.impl.AgencyAndRouteComparator)1 RouteComparator (org.onebusaway.presentation.impl.RouteComparator)1 AgencyWithCoverageBean (org.onebusaway.transit_data.model.AgencyWithCoverageBean)1 RouteBean (org.onebusaway.transit_data.model.RouteBean)1