Package org.onebusaway.transit_data.model.trips

Examples of org.onebusaway.transit_data.model.trips.TripBean


    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();
   
View Full Code Here


  @Override
  public BlockTripBean getBlockTripAsBean(BlockTripEntry blockTrip) {

    TripEntry trip = blockTrip.getTrip();
    TripBean tripBean = _tripBeanService.getTripForId(trip.getId());
    if (tripBean == null)
      throw new IllegalStateException("unknown trip: " + trip.getId());

    BlockTripBean bean = new BlockTripBean();
    bean.setTrip(tripBean);
View Full Code Here

      bean.setDistanceAlongTrip(blockLocation.getDistanceAlongBlock()
          - activeBlockTrip.getDistanceAlongBlock());
      TripEntry activeTrip = activeBlockTrip.getTrip();
      bean.setTotalDistanceAlongTrip(activeTrip.getTotalTripDistance());

      TripBean activeTripBean = _tripBeanService.getTripForId(activeTrip.getId());
      bean.setActiveTrip(activeTripBean);
      bean.setBlockTripSequence(activeBlockTrip.getSequence());

      if (blockLocation.isLastKnownDistanceAlongBlockSet()) {
        bean.setLastKnownDistanceAlongTrip(blockLocation.getLastKnownDistanceAlongBlock()
View Full Code Here

  private TripDetailsBean getTripEntryAndBlockLocationAsTripDetails(
      BlockTripInstance blockTripInstance, BlockLocation blockLocation,
      TripDetailsInclusionBean inclusion, long time) {

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

    /****
     *
     ****/

    TripBean tripABean = new TripBean();
    Mockito.when(_tripBeanService.getTripForId(aid("tripA"))).thenReturn(
        tripABean);

    TripBean tripBBean = new TripBean();
    Mockito.when(_tripBeanService.getTripForId(aid("tripB"))).thenReturn(
        tripBBean);

    /****
     *
 
View Full Code Here

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

    TripNarrative tripNarrative = _narrativeService.getTripForId(tripId);

    TripBean tripBean = new TripBean();

    tripBean.setId(ApplicationBeanLibrary.getId(tripId));

    tripBean.setTripShortName(tripNarrative.getTripShortName());
    tripBean.setTripHeadsign(tripNarrative.getTripHeadsign());
    tripBean.setRoute(routeBean);
    tripBean.setRouteShortName(tripNarrative.getRouteShortName());
    tripBean.setServiceId(ApplicationBeanLibrary.getId(tripEntry.getServiceId().getId()));

    AgencyAndId shapeId = tripEntry.getShapeId();
    if (shapeId != null && shapeId.hasValues())
      tripBean.setShapeId(ApplicationBeanLibrary.getId(shapeId));

    tripBean.setDirectionId(tripEntry.getDirectionId());
    tripBean.setTotalTripDistance(tripEntry.getTotalTripDistance());
   
    BlockEntry block = tripEntry.getBlock();
    tripBean.setBlockId(ApplicationBeanLibrary.getId(block.getId()));
   
    return tripBean;
  }
View Full Code Here

      FrequencyBean frequency = FrequencyBeanLibrary.getBeanForFrequency(
          blockTripInstanceFrom.getServiceDate(), frequencyLabel);
      transitLeg.setFrequency(frequency);
    }

    TripBean tripBean = _tripBeanService.getTripForId(trip.getId());
    transitLeg.setTrip(tripBean);

    transitLeg.setScheduledDepartureTime(builder.getScheduledDepartureTime());
    transitLeg.setScheduledArrivalTime(builder.getScheduledArrivalTime());
View Full Code Here

    TripProblemReportQueryBean query = new TripProblemReportQueryBean();

    AgencyAndId tripIdA = new AgencyAndId("1", "t-a");
    AgencyAndId tripIdB = new AgencyAndId("1", "t-b");

    TripBean tripA = new TripBean();
    TripBean tripB = new TripBean();

    Mockito.when(
        _dao.getTripProblemReportSummaries(query, ETripProblemGroupBy.TRIP)).thenReturn(
        Arrays.asList(Tuples.tuple((Object) tripIdA, 7),
            Tuples.tuple((Object) tripIdB, 3)));
View Full Code Here

    BlockConfigurationEntry blockConfig = blockTrip.getBlockConfiguration();
    StopTimeEntry stopTime = blockStopTime.getStopTime();
    StopEntry stop = stopTime.getStop();
    TripEntry trip = stopTime.getTrip();

    TripBean tripBean = _tripBeanService.getTripForId(trip.getId());
    pab.setTrip(tripBean);
    pab.setBlockTripSequence(blockTrip.getSequence());

    pab.setArrivalEnabled(blockStopTime.getBlockSequence() > 0);
    pab.setDepartureEnabled(blockStopTime.getBlockSequence() + 1 < blockConfig.getStopTimes().size());
View Full Code Here

    Object obj = findValue(_value);

    if( obj instanceof TripBean) {
     
      TripBean trip = (TripBean) obj;
      String routeShortName = trip.getRouteShortName();
     
      if( routeShortName != null) {
        try {
          writer.write(routeShortName);
        } catch (IOException e) {
          LOG.error("Could not write out Text tag", e);
        }
      }
      else {
        obj = trip.getRoute();
      }
    }
   
    if (obj instanceof RouteBean) {
      RouteBean route = (RouteBean) obj;
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.trips.TripBean

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.