_route = _transitDataService.getRouteForId(_id);
StopsForRouteBean stopsForRoute = _transitDataService.getStopsForRoute(_id);
Map<String, StopGroupingBean> groupingsByType = MappingLibrary.mapToValue(
stopsForRoute.getStopGroupings(), "type", String.class);
StopGroupingBean byDirection = groupingsByType.get(TransitDataConstants.STOP_GROUPING_TYPE_DIRECTION);
if (_groupIndex == -1) {
if (byDirection != null) {
for (StopGroupBean group : byDirection.getStopGroups())
_directionNames.add(group.getName());
}
_stops = stopsForRoute.getStops();
Collections.sort(_stops, _stopNameComparator);
} else {
if (byDirection == null)
return INPUT;
List<StopGroupBean> groups = byDirection.getStopGroups();
if (_groupIndex < 0 && groups.size() <= _groupIndex)
return INPUT;
Map<String, StopBean> stopById = MappingLibrary.mapToValue(
stopsForRoute.getStops(), "id", String.class);