Examples of StopBean


Examples of org.onebusaway.transit_data.model.StopBean

    /****
     *
     ****/

    StopBean stopABean = new StopBean();
    stopABean.setId("1_stopA");
    Mockito.when(_stopBeanService.getStopForId(stopA.getId())).thenReturn(
        stopABean);

    StopBean stopBBean = new StopBean();
    stopBBean.setId("1_stopB");
    Mockito.when(_stopBeanService.getStopForId(stopB.getId())).thenReturn(
        stopBBean);

    /****
     *
 
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    List<BlockTripIndex> blockIndices = blockTripIndices(blockA);
    Mockito.when(
        _blockIndexService.getBlockTripIndicesForRouteCollectionId(routeId)).thenReturn(
        blockIndices);

    StopBean stopBeanA = getStopBean(stopA);
    StopBean stopBeanB = getStopBean(stopB);
    StopBean stopBeanC = getStopBean(stopC);

    List<AgencyAndId> stopIds = Arrays.asList(stopA.getId(), stopB.getId(),
        stopC.getId());
    Mockito.when(_routeService.getStopsForRouteCollection(routeId)).thenReturn(
        stopIds);
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    assertEquals(ids(stopC.getId(), stopA.getId()), stopIdsB);

  }

  private StopBean getStopBean(StopEntryImpl stopEntry) {
    StopBean stop = new StopBean();
    stop.setId(AgencyAndIdLibrary.convertToString(stopEntry.getId()));
    return stop;
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    Collection<AgencyAndId> stopIds = _routeService.getStopsForRouteCollection(routeId);
    List<StopBean> stops = new ArrayList<StopBean>();

    for (AgencyAndId stopId : stopIds) {
      StopBean stop = _stopBeanService.getStopForId(stopId);
      stops.add(stop);
    }

    return stops;
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

  private ServiceAlertsBeanService _serviceAlertsBeanService;

  public StopWithArrivalsAndDeparturesBean getArrivalsAndDeparturesByStopId(
      AgencyAndId id, ArrivalsAndDeparturesQueryBean query) {

    StopBean stop = _stopBeanService.getStopForId(id);

    if (stop == null)
      return null;

    List<ArrivalAndDepartureBean> arrivalsAndDepartures = _arrivalsAndDeparturesBeanService.getArrivalsAndDeparturesByStopId(
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    Map<String, ServiceAlertBean> situationsById = new HashMap<String, ServiceAlertBean>();
    Counter<TimeZone> timeZones = new Counter<TimeZone>();

    for (AgencyAndId id : ids) {

      StopBean stopBean = _stopBeanService.getStopForId(id);
      stops.add(stopBean);

      List<ArrivalAndDepartureBean> arrivalsAndDepartures = _arrivalsAndDeparturesBeanService.getArrivalsAndDeparturesByStopId(
          id, query);
      allArrivalsAndDepartures.addAll(arrivalsAndDepartures);

      List<AgencyAndId> nearbyStopIds = _nearbyStopsBeanService.getNearbyStops(
          stopBean, 100);
      allNearbyStopIds.addAll(nearbyStopIds);

      TimeZone timeZone = _agencyService.getTimeZoneForAgencyId(id.getAgencyId());
      timeZones.increment(timeZone);

      List<ServiceAlertBean> situations = _serviceAlertsBeanService.getServiceAlertsForStopId(
          query.getTime(), id);
      for (ServiceAlertBean situation : situations)
        situationsById.put(situation.getId(), situation);
    }

    allNearbyStopIds.removeAll(ids);
    List<StopBean> nearbyStops = new ArrayList<StopBean>();

    for (AgencyAndId id : allNearbyStopIds) {
      StopBean stop = _stopBeanService.getStopForId(id);
      nearbyStops.add(stop);
    }

    TimeZone timeZone = timeZones.getMax();
    if (timeZone == null)
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

      bean.setActiveTrip(activeTripBean);
    }

    BlockStopTimeEntry stop = blockLocation.getClosestStop();
    if (stop != null) {
      StopBean stopBean = _stopBeanService.getStopForId(stop.getStopTime().getStop().getId());
      bean.setClosestStop(stopBean);
      bean.setClosestStopTimeOffset(blockLocation.getClosestStopTimeOffset());
    }

    bean.setPredicted(blockLocation.isPredicted());
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    StopTimeNarrative stopTimeNarrative = _narrativeService.getStopTimeForEntry(stopTime);
    pab.setRouteShortName(stopTimeNarrative.getRouteShortName());
    pab.setTripHeadsign(stopTimeNarrative.getStopHeadsign());

    StopBean stopBean = stopBeanCache.get(stop.getId());

    if (stopBean == null) {
      stopBean = _stopBeanService.getStopForId(stop.getId());
      stopBeanCache.put(stop.getId(), stopBean);
    }
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    StopScheduleBean bean = new StopScheduleBean();
    bean.setDate(date);

    AgencyAndId id = convertAgencyAndId(stopId);
    StopBean stopBean = _stopBeanService.getStopForId(id);
    if (stopBean == null)
      return null;
    bean.setStop(stopBean);

    ServiceDate serviceDate = new ServiceDate(date);
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    List<AgencyAndId> stops = _whereGeospatialService.getStopsByBounds(bounds);

    Set<RouteBean> routes = new HashSet<RouteBean>();
    for (AgencyAndId stopId : stops) {
      StopBean stop = _stopService.getStopForId(stopId);
      routes.addAll(stop.getRoutes());
    }

    List<RouteBean> routeBeans = new ArrayList<RouteBean>(routes);
    boolean limitExceeded = BeanServiceSupport.checkLimitExceeded(routeBeans,
        query.getMaxCount());
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.