Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.TripStopTimesBean


  @Override
  public TripStopTimesBean getStopTimesForBlockTrip(BlockTripInstance blockTripInstance) {

    BlockTripEntry blockTrip = blockTripInstance.getBlockTrip();
    TripStopTimesBean bean = getStopTimesForTrip(blockTrip.getTrip());

    if (blockTrip.getPreviousTrip() != null) {
      BlockTripEntry previous = blockTrip.getPreviousTrip();
      TripBean previousTrip = _tripBeanService.getTripForId(previous.getTrip().getId());
      bean.setPreviousTrip(previousTrip);
    }

    if (blockTrip.getNextTrip() != null) {
      BlockTripEntry next = blockTrip.getNextTrip();
      TripBean nextTrip = _tripBeanService.getTripForId(next.getTrip().getId());
      bean.setNextTrip(nextTrip);
    }
   
    FrequencyEntry frequencyLabel = blockTripInstance.getFrequencyLabel();
   
    if( frequencyLabel != null) {
      long serviceDate = blockTripInstance.getServiceDate();
      FrequencyBean fb = FrequencyBeanLibrary.getBeanForFrequency(serviceDate, frequencyLabel);
      bean.setFrequency(fb);
    }

    return bean;
  }
View Full Code Here


  private TripStopTimesBean getStopTimesForTrip(TripEntry trip) {

    AgencyAndId tripId = trip.getId();

    TripStopTimesBean bean = new TripStopTimesBean();

    TimeZone tz = _agencyService.getTimeZoneForAgencyId(tripId.getAgencyId());
    bean.setTimeZone(tz.getID());

    for (StopTimeEntry stopTime : trip.getStopTimes()) {

      TripStopTimeBean stBean = new TripStopTimeBean();

      stBean.setArrivalTime(stopTime.getArrivalTime());
      stBean.setDepartureTime(stopTime.getDepartureTime());

      StopEntry stopEntry = stopTime.getStop();
      StopBean stopBean = _stopBeanService.getStopForId(stopEntry.getId());
      stBean.setStop(stopBean);
      stBean.setDistanceAlongTrip(stopTime.getShapeDistTraveled());
      bean.addStopTime(stBean);
    }

    return bean;
  }
View Full Code Here

      TripDetailsInclusionBean inclusion, long time) {

    TripBean trip = null;
    long serviceDate = blockTripInstance.getServiceDate();
    FrequencyBean frequency = null;
    TripStopTimesBean stopTimes = null;
    TripStatusBean status = null;
    AgencyAndId vehicleId = null;

    boolean missing = false;
View Full Code Here

    TripBean trip = tripDetails.getTrip();
    if (trip != null)
      addToReferences(trip);

    TripStopTimesBean stopTimes = tripDetails.getSchedule();
    if (stopTimes != null)
      bean.setSchedule(getTripStopTimes(stopTimes));

    TripStatusBean status = tripDetails.getStatus();
    if (status != null)
View Full Code Here

    _tripDetails = _service.getSingleTripDetails(query);

    if (_tripDetails == null)
      throw new NoSuchTripServiceException(_id);

    TripStopTimesBean stopTimes = _tripDetails.getSchedule();
    _timeZone = TimeZone.getTimeZone(stopTimes.getTimeZone());

    _actualServiceDate = getActualServiceDate();
    return SUCCESS;
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.TripStopTimesBean

Copyright © 2018 www.massapicom. 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.