@Override public String getNameForStops(List<StopBean> stops) { StringBuilder b = new StringBuilder(); for (int i = 0; i < stops.size(); i++) { if (i > 0) { if (i < stops.size() - 1) b.append(", "); else b.append(" and "); } StopBean stop = stops.get(i); b.append(stop.getName()); } return b.toString(); }
@Override public String getNameForStops(List<StopBean> stops) { StringBuilder b = new StringBuilder(); for (int i = 0; i < stops.size(); i++) { if (i > 0) { if (i < stops.size() - 1) b.append(", "); else b.append(" and "); } StopBean stop = stops.get(i); b.append(stop.getName()); } return b.toString(); }
@Override public String summarizeStop(String stopIdStr) { // return the stop name try { AgencyAndId routeId = AgencyAndIdLibrary.convertFromString(stopIdStr); StopBean stop = _tds.getStop(routeId.toString()); if (stop == null || stop.getName() == null) return stopIdStr; return stop.getName(); } catch (IllegalStateException ise) { // invalid id -- return it as is return stopIdStr; } catch (NoSuchStopServiceException nsse) { // something went wrong _log.error("couldn't find stop for stopId=|" + stopIdStr + "|"); return stopIdStr; } } }
public StopItem(StopBean stopBean, List<DistanceAway> distanceAways) { this(idParser.parseIdWithoutAgency(stopBean.getId()), stopBean.getName(), distanceAways); }
private String toStringRecursive(String prefix) { if (hasStop()) return prefix + getStop().getName(); StringBuilder b = new StringBuilder(); for (NameBean name : getNames()) { if (b.length() > 0) b.append('\n'); b.append(prefix).append(name.getName()).append('\n'); b.append(getSubTree(name).toStringRecursive(prefix + " ")); } return b.toString(); } }
private String toStringRecursive(String prefix) { if (hasStop()) return prefix + getStop().getName(); StringBuilder b = new StringBuilder(); for (NameBean name : getNames()) { if (b.length() > 0) b.append('\n'); b.append(prefix).append(name.getName()).append('\n'); b.append(getSubTree(name).toStringRecursive(prefix + " ")); } return b.toString(); } }
private void updateCurrentUser() { // Save the last selected stop id _currentUserService.setLastSelectedStopIds(_stopIds); _user = _currentUserService.getCurrentUser(); if (_user == null || !_user.hasDefaultLocation()) { List<StopBean> stops = _result.getStops(); StopBean stop = stops.get(0); _defaultSearchLocationService.setDefaultLocationForCurrentUser( stop.getName(), stop.getLat(), stop.getLon()); } }
private void updateCurrentUser() { // Save the last selected stop id _currentUserService.setLastSelectedStopIds(_stopIds); _user = _currentUserService.getCurrentUser(); if (_user == null || !_user.hasDefaultLocation()) { List<StopBean> stops = _result.getStops(); StopBean stop = stops.get(0); _defaultSearchLocationService.setDefaultLocationForCurrentUser( stop.getName(), stop.getLat(), stop.getLon()); } }
private void groupByStop(StopSelectionTreeBean tree, Iterable<StopBean> stops) { for (StopBean stop : stops) { StopSelectionTreeBean subTree = tree; if (_splitStopNames) { List<NameBean> names = _locationNameSplitStrategy.splitLocationNameIntoParts(stop.getName()); for (NameBean name : names) subTree = subTree.getSubTree(name); } else { NameBean name = new NameBean(SelectionNameTypes.STOP_NAME, stop.getName()); subTree = subTree.getSubTree(name); } // As a last resort, we extend the tree by the stop number (guaranteed to // be unique) String code = stop.getCode() != null ? stop.getCode() : stop.getId(); NameBean name = new NameBean(SelectionNameTypes.STOP_DESCRIPTION, "Stop # " + code); subTree = subTree.getSubTree(name); subTree.setStop(stop); } }
private void groupByStop(StopSelectionTreeBean tree, Iterable<StopBean> stops) { for (StopBean stop : stops) { StopSelectionTreeBean subTree = tree; if (_splitStopNames) { List<NameBean> names = _locationNameSplitStrategy.splitLocationNameIntoParts(stop.getName()); for (NameBean name : names) subTree = subTree.getSubTree(name); } else { NameBean name = new NameBean(SelectionNameTypes.STOP_NAME, stop.getName()); subTree = subTree.getSubTree(name); } // As a last resort, we extend the tree by the stop number (guaranteed to // be unique) String code = stop.getCode() != null ? stop.getCode() : stop.getId(); NameBean name = new NameBean(SelectionNameTypes.STOP_DESCRIPTION, "Stop # " + code); subTree = subTree.getSubTree(name); subTree.setStop(stop); } }
String stopName = stopBean.getName(); String stopDirection = stopBean.getDirection(); List<Double> latLng = Arrays.asList(new Double[] {stopBean.getLat(), stopBean.getLon()});
stopPoint.setValue(stopBean.getName()); onwardCallStructure.setStopPointName(stopPoint);
addText(_destinationPronunciation.modify(stop.getName()));
stopPoint.setValue(stopBean.getName()); monitoredCallStructure.setStopPointName(stopPoint);
public StopV2Bean getStop(StopBean stop) { StopV2Bean bean = new StopV2Bean(); bean.setCode(stop.getCode()); bean.setDirection(stop.getDirection()); bean.setId(stop.getId()); bean.setLat(stop.getLat()); bean.setLon(stop.getLon()); bean.setLocationType(stop.getLocationType()); bean.setName(stop.getName()); bean.setWheelchairBoarding(stop.getWheelchairBoarding()); List<String> routeIds = new ArrayList<String>(); for (RouteBean route : stop.getRoutes()) { routeIds.add(route.getId()); addToReferences(route); } bean.setRouteIds(routeIds); return bean; }
public StopV2Bean getStop(StopBean stop) { StopV2Bean bean = new StopV2Bean(); bean.setCode(stop.getCode()); bean.setDirection(stop.getDirection()); bean.setId(stop.getId()); bean.setLat(stop.getLat()); bean.setLon(stop.getLon()); bean.setLocationType(stop.getLocationType()); bean.setName(stop.getName()); bean.setWheelchairBoarding(stop.getWheelchairBoarding()); List<String> routeIds = new ArrayList<String>(); for (RouteBean route : stop.getRoutes()) { routeIds.add(route.getId()); addToReferences(route); } bean.setRouteIds(routeIds); return bean; }
db.beginTransaction(); String sql = "INSERT INTO stop(atco_code, name, locality, bearing, latitude, longitude) VALUES (?,?,?,?,?,?)"; SQLiteStatement stmt = db.compileStatement(sql); for(StopBean stop : stopList){ stmt.bindString(1, stop.getAtco_code()); stmt.bindString(2, stop.getName()); stmt.bindString(3, stop.getLocality(); stmt.bindString(4, stop.getBearing()); stmt.bindDouble(5, stop.getLatitude()); stmt.bindDouble(6, stop.getLongitude()); stmt.execute(); stmt.clearBindings(); } db.setTransactionSuccessful(); db.endTransaction();
addText(_destinationPronunciation.modify(stop.getName()));