@Override public List<StopBean> filterRevenueService(AgencyBean agency, StopsBean stops) { // TODO Auto-generated method stub return stops.getStops(); }
private StopsBean constructResult(List<StopBean> stopBeans, boolean limitExceeded) { Collections.sort(stopBeans, new StopBeanIdComparator()); StopsBean result = new StopsBean(); result.setStops(stopBeans); result.setLimitExceeded(limitExceeded); return result; }
public ListWithReferencesBean<StopV2Bean> getResponse(StopsBean result) { List<StopV2Bean> beans = new ArrayList<StopV2Bean>(); for (StopBean stop : result.getStops()) beans.add(getStop(stop)); return list(beans, result.isLimitExceeded(), false); }
@Override public StopsBean getStopsByName(String stopName) throws ServiceException { List<StopBean> stopBeans = new ArrayList<StopBean>(); SearchResult<AgencyAndId> results = null; try { results = _searchService.searchForStopsByName(stopName, MAX_STOPS, NAME_MIN_SCORE); for (AgencyAndId aid : results.getResultsByTopScore()) { StopBean stopBean = _stopBeanService.getStopForId(aid); if (stopBean != null) { stopBeans.add(stopBean); } } } catch (Exception e) { _log.error("search failed!", e); // simply return no results, the search was not understood return new StopsBean(); } if (results == null) { return new StopsBean(); } return constructResult(stopBeans, results.size() == MAX_STOPS); }
_stops = stopsBean.getStops();
public ListWithReferencesBean<StopV2Bean> getResponse(StopsBean result) { List<StopV2Bean> beans = new ArrayList<StopV2Bean>(); for (StopBean stop : result.getStops()) beans.add(getStop(stop)); return list(beans, result.isLimitExceeded(), false); }
private StopsBean constructResult(List<StopBean> stopBeans, boolean limitExceeded) { Collections.sort(stopBeans, new StopBeanIdComparator()); StopsBean result = new StopsBean(); result.setStops(stopBeans); result.setLimitExceeded(limitExceeded); return result; }
StopsBean stops = transitService.getStops(queryBean); for (StopBean stopBean : stops.getStops()) { StopSearchResult stopSearchResult = makeStopSearchResult(stopBean, m); results.add(stopSearchResult); for (StopBean stopBean : stopsBean.getStops()) { boolean useStop = false; List<StopBean> stopsList = stopsBean.getStops();
private void tryAsStopName(SearchResultCollection results, String q, SearchResultFactory resultFactory){ StopsBean beans =_transitDataService.getStopsByName(q); int count = 0; if (beans == null || beans.getStops() == null) return; for (StopBean stopBean : beans.getStops()) { String agencyId = AgencyAndIdLibrary.convertFromString(stopBean.getId()).getAgencyId(); // filter out stops not in service if (_transitDataService.stopHasRevenueService(agencyId, stopBean.getId())) { // this is a fuzzy match so just a suggestion results.addSuggestion(resultFactory.getStopResult(stopBean, results.getRouteFilter())); count++; } if (count > MAX_STOPS) { break; } } return; }