use of org.onebusaway.nextbus.model.nextbus.DisplayRoute in project onebusaway-application-modules by camsys.
the class RouteListAction method getModel.
@Override
public Body<DisplayRoute> getModel() {
Body<DisplayRoute> body = new Body<DisplayRoute>();
if (isValid(body)) {
List<RouteBean> routeBeans = _transitDataService.getRoutesForAgencyId(agencyId).getList();
Collections.sort(routeBeans, new Comparator<RouteBean>() {
AlphanumComparator alphaComparator = new AlphanumComparator();
public int compare(RouteBean arg0, RouteBean arg1) {
return alphaComparator.compare(arg0.getId(), arg1.getId());
}
});
for (RouteBean routeBean : routeBeans) {
DisplayRoute route = new DisplayRoute();
route.setTag(getIdNoAgency(routeBean.getId()));
route.setTitle(routeBean.getShortName() + " " + routeBean.getLongName());
body.getResponse().add(route);
}
}
return body;
}
Aggregations