Examples of RouteBean


Examples of org.onebusaway.transit_data.model.RouteBean

  public DefaultHttpHeaders show() throws ServiceException {

    if (hasErrors())
      return setValidationErrorsResponse();

    RouteBean route = _service.getRouteForId(_id);

    if (route == null)
      return setResourceNotFoundResponse();

    if (isVersion(V1)) {
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

    List<RouteBean> routeBeans = new ArrayList<RouteBean>(
        routeCollectionIds.size());

    for (AgencyAndId routeCollectionId : routeCollectionIds) {
      RouteBean bean = _routeBeanService.getRouteForId(routeCollectionId);
      routeBeans.add(bean);
    }

    Collections.sort(routeBeans, _routeBeanComparator);
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

    Mockito.when(_routeService.getRouteCollectionIdsForStop(stopId)).thenReturn(
        routeIds);

    RouteBean.Builder routeBuilder = RouteBean.builder();
    routeBuilder.setId(AgencyAndIdLibrary.convertToString(routeId));
    RouteBean route = routeBuilder.create();
    Mockito.when(_routeBeanService.getRouteForId(routeId)).thenReturn(route);

    StopBean stopBean = _service.getStopForId(stopId);

    assertNotNull(stopBean);
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

    if (tripEntry == null)
      return null;

    AgencyAndId routeId = tripEntry.getRouteCollection().getId();
    RouteBean routeBean = _routeBeanService.getRouteForId(routeId);

    TripNarrative tripNarrative = _narrativeService.getTripForId(tripId);

    TripBean tripBean = new TripBean();
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

    AgencyBean agency = new AgencyBean();
    Mockito.when(_agencyBeanService.getAgencyForId("1")).thenReturn(agency);

    Mockito.when(_narrativeService.getRouteCollectionForId(routeId)).thenReturn(
        route);
    RouteBean bean = _service.getRouteForId(routeId);

    assertEquals(route.getColor(), bean.getColor());
    assertEquals(route.getDescription(), bean.getDescription());
    assertEquals(AgencyAndIdLibrary.convertToString(routeId), bean.getId());
    assertEquals(route.getLongName(), bean.getLongName());
    assertEquals(route.getShortName(), bean.getShortName());
    assertEquals(route.getTextColor(), bean.getTextColor());
    assertEquals(route.getType(), bean.getType());
    assertEquals(route.getUrl(), bean.getUrl());
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

    for (AgencyAndId routeId : routeIds) {

      StopRouteScheduleBean routeScheduleBean = new StopRouteScheduleBean();
      beans.add(routeScheduleBean);

      RouteBean route = _routeBeanService.getRouteForId(routeId);
      routeScheduleBean.setRoute(route);

      Map<String, StopTimeByDirectionEntry> stopTimesByDirection = new FactoryMap<String, StopTimeByDirectionEntry>(
          new StopTimeByDirectionEntry());
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

      StopTimeGroupBean group = new StopTimeGroupBean();

      String groupId = Integer.toString(groups.size());
      group.setId(groupId);

      RouteBean route = _routeBeanService.getRouteForId(lineId);
      group.setContinuesAs(route);

      applyGroupIdForGroupKey(stopTimesForDirection, key, groupId);

      groups.add(group);
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

    if (agency == null)
      throw new NoSuchAgencyServiceException(agencyId);
    List<RouteBean> routes = new ArrayList<RouteBean>();
    for (RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
      AgencyAndId routeId = routeCollection.getId();
      RouteBean route = _routeBeanService.getRouteForId(routeId);
      routes.add(route);
    }
    return new ListBean<RouteBean>(routes, false);
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

          bounds.getMinLat(), bounds.getMaxLat());
      HasItemsVisitor v = new HasItemsVisitor();
      tree.query(env, v);

      if (v.hasItems()) {
        RouteBean routeBean = _routeBeanService.getRouteForId(id);
        routeBeans.add(routeBean);
      }
    }

    boolean limitExceeded = BeanServiceSupport.checkLimitExceeded(routeBeans,
View Full Code Here

Examples of org.onebusaway.transit_data.model.RouteBean

        obj = trip.getRoute();
      }
    }
   
    if (obj instanceof RouteBean) {
      RouteBean route = (RouteBean) obj;
      String name = RoutePresenter.getNameForRoute(route);
      try {
        writer.write(name);
      } catch (IOException e) {
        LOG.error("Could not write out Text tag", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.