Examples of JourneyHeaderElement


Examples of org.onebusaway.uk.atco_cif.JourneyHeaderElement

  }

  private void constructTrips() {
    for (List<JourneyHeaderElement> journies : _journeysById.values()) {
      for (int i = 0; i < journies.size(); ++i) {
        JourneyHeaderElement journey = journies.get(i);
        if (journey.getOperatorId().equals("EU")) {
          continue;
        }
        Trip trip = new Trip();
        String id = journey.getOperatorId() + "-"
            + journey.getJourneyIdentifier();
        if (journies.size() > 1) {
          id += "-" + i;
        }
        trip.setId(new AgencyAndId(journey.getOperatorId(), id));
        trip.setRoute(getRouteForJourney(journey));
        trip.setServiceId(getServiceIdForJourney(journey));

        AgencyAndId routeId = trip.getRoute().getId();
        RouteMetadata metadata = getMetadataForRouteId(routeId);

        String directionName = metadata.getDirectionNameForDirectionId(journey.getRouteDirection());
        if (!isEmpty(directionName)) {
          trip.setTripHeadsign(directionName);
        }
        Integer directionId = metadata.getDirectionIdForDirection(journey.getRouteDirection());
        if (directionId != null) {
          trip.setDirectionId(directionId.toString());
        }

        if (constructTimepoints(journey, trip)) {
View Full Code Here

Examples of org.onebusaway.uk.atco_cif.JourneyHeaderElement

    }

    @Override
    public void startElement(Element element) {
      if (element instanceof JourneyHeaderElement) {
        JourneyHeaderElement journey = (JourneyHeaderElement) element;
        AgencyAndId journeyId = new AgencyAndId(journey.getOperatorId(),
            journey.getJourneyIdentifier());
        List<JourneyHeaderElement> journies = _journeysById.get(journeyId);
        if (journies == null) {
          journies = new ArrayList<JourneyHeaderElement>();
          _journeysById.put(journeyId, journies);
        }
        journies.add(journey);
        AgencyAndId routeId = getRouteIdForJourney(journey);
        RouteMetadata metadata = getMetadataForRouteId(routeId);
        metadata.addDirection(journey.getRouteDirection());
      } else if (element instanceof LocationElement) {
        LocationElement location = (LocationElement) element;
        _locationById.put(location.getLocationId(), location);
      } else if (element instanceof AdditionalLocationElement) {
        AdditionalLocationElement location = (AdditionalLocationElement) element;
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.