Examples of StopBean


Examples of org.onebusaway.transit_data.model.StopBean

  public StopScheduleV2Bean getStopSchedule(StopScheduleBean stopSchedule) {

    StopScheduleV2Bean bean = new StopScheduleV2Bean();

    StopBean stop = stopSchedule.getStop();
    if (stop != null) {
      addToReferences(stop);
      bean.setStopId(stop.getId());
    }

    bean.setDate(stopSchedule.getDate().getTime());

    List<StopRouteScheduleV2Bean> stopRouteScheduleBeans = new ArrayList<StopRouteScheduleV2Bean>();
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

  public ArrivalAndDepartureV2Bean getArrivalAndDeparture(
      ArrivalAndDepartureBean ad) {

    TripBean trip = ad.getTrip();
    RouteBean route = trip.getRoute();
    StopBean stop = ad.getStop();

    ArrivalAndDepartureV2Bean bean = new ArrivalAndDepartureV2Bean();

    bean.setTripId(trip.getId());
    addToReferences(trip);

    bean.setServiceDate(ad.getServiceDate());
    bean.setVehicleId(ad.getVehicleId());
    bean.setStopId(stop.getId());
    addToReferences(stop);
    bean.setStopSequence(ad.getStopSequence());
    bean.setBlockTripSequence(ad.getBlockTripSequence());

    bean.setRouteId(route.getId());
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    HashMap<String, Integer> visitNumberForStop = new HashMap<String, Integer>();
    boolean afterStart = false;
    boolean afterStop = currentStop == null;
    int i = 0;
    for (TripStopTimeBean stopTime : stopTimes) {
      StopBean stop = stopTime.getStop();
      int visitNumber = getVisitNumber(visitNumberForStop, stop);
      if (stopTime.getDistanceAlongTrip() >= distance) {
        afterStart = true;
      }
      if (afterStart) {
        i += 1;
        if (afterStop) {
          OnwardCall onwardCall = new OnwardCall();
          onwardCall.StopPointRef = SiriUtils.getIdWithoutAgency(stop.getId());
          onwardCall.StopPointName = stop.getName();
          onwardCall.VisitNumber = visitNumber;
          onwardCall.Extensions = new DistanceExtensions();

          onwardCall.Extensions.Distances = new Distances();
          onwardCall.Extensions.Distances.DistanceFromCall = stopTime.getDistanceAlongTrip()
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

        "%1$tY-%1$tm-%1$td", serviceDate);
    monitoredVehicleJourney.FramedVehicleJourneyRef.DatedVehicleJourneyRef = trip.getTripId();

    List<TripStopTimeBean> stops = trip.getSchedule().getStopTimes();
    monitoredVehicleJourney.OriginRef = getIdWithoutAgency(stops.get(0).getStop().getId());
    StopBean lastStop = stops.get(stops.size() - 1).getStop();
    monitoredVehicleJourney.DestinationRef = getIdWithoutAgency(lastStop.getId());

    StopBean nextStop = trip.getStatus().getNextStop();
    if (nextStop != null) {
      monitoredVehicleJourney.MonitoredCall = new MonitoredCall();
      monitoredVehicleJourney.MonitoredCall.StopPointRef = nextStop.getId();
      monitoredVehicleJourney.MonitoredCall.StopPointName = nextStop.getName();
      monitoredVehicleJourney.MonitoredCall.VisitNumber = 1; // FIXME: this is
                                                             // theoretically
                                                             // wrong but
                                                             // practically
                                                             // rarely so
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

      tripDesc.setRouteId(normalizeId(route.getId()));

      VehicleDescriptor.Builder vehicleDesc = tripUpdate.getVehicleBuilder();
      vehicleDesc.setId(normalizeId(vehicle.getVehicleId()));

      StopBean nextStop = tripStatus.getNextStop();
      if (nextStop != null) {
        TripUpdate.StopTimeUpdate.Builder stopTimeUpdate = tripUpdate.addStopTimeUpdateBuilder();
        stopTimeUpdate.setStopId(normalizeId(nextStop.getId()));
        TripUpdate.StopTimeEvent.Builder departure = stopTimeUpdate.getDepartureBuilder();
        departure.setTime(timestamp / 1000 + tripStatus.getNextStopTimeOffset());
      }

      tripUpdate.setTimestamp(vehicle.getLastUpdateTime() / 1000);
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

  public DefaultHttpHeaders show() throws ServiceException {

    if (hasErrors())
      return setValidationErrorsResponse();

    StopBean stop = _service.getStop(_id);

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

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

Examples of org.onebusaway.transit_data.model.StopBean

    }

    if (index >= selectionIndices.size()) {

      for (NameBean name : names) {
        StopBean stop = getStop(tree.getSubTree(name));
        if (stop != null) {
          selection.addNameWithStop(name, stop);
        } else {
          selection.addName(name);
        }
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

        if (i < stops.size() - 1)
          b.append(", ");
        else
          b.append(" and ");
      }
      StopBean stop = stops.get(i);
      b.append(stop.getName());
    }
    return b.toString();
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

   ****/

  private List<StopBean> getStopsForStopIds(List<String> stopIds) {
    List<StopBean> stops = new ArrayList<StopBean>(stopIds.size());
    for (String stopId : stopIds) {
      StopBean stop = _transitDataService.getStop(stopId);
      if (stop != null)
        stops.add(stop);
    }
    return stops;
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopBean

    _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());
    }
  }
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.