use of org.onebusaway.transit_data.model.ListBean in project onebusaway-application-modules by camsys.
the class RoutesBeanServiceImpl method getRouteIdsForAgencyId.
@Cacheable
@Override
public ListBean<String> getRouteIdsForAgencyId(String agencyId) {
AgencyEntry agency = _graphDao.getAgencyForId(agencyId);
if (agency == null)
throw new NoSuchAgencyServiceException(agencyId);
List<String> ids = new ArrayList<String>();
for (RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
AgencyAndId id = routeCollection.getId();
ids.add(AgencyAndIdLibrary.convertToString(id));
}
return new ListBean<String>(ids, false);
}
use of org.onebusaway.transit_data.model.ListBean in project onebusaway-application-modules by camsys.
the class ShapeBeanServiceImpl method getShapeIdsForAgencyId.
@Override
public ListBean<String> getShapeIdsForAgencyId(String agencyId) {
Set<AgencyAndId> shapeIds = new HashSet<AgencyAndId>();
for (TripEntry trip : _transitGraphDao.getAllTrips()) {
AgencyAndId shapeId = trip.getShapeId();
if (shapeId == null || !shapeId.hasValues())
continue;
if (!shapeId.getAgencyId().equals(agencyId))
continue;
shapeIds.add(shapeId);
}
List<String> ids = new ArrayList<String>();
for (AgencyAndId shapeId : shapeIds) {
String id = AgencyAndIdLibrary.convertToString(shapeId);
ids.add(id);
}
Collections.sort(ids);
return new ListBean<String>(ids, false);
}
Aggregations