Package org.onebusaway.gtfs.model.calendar

Examples of org.onebusaway.gtfs.model.calendar.ServiceInterval


   ****/

  protected static ServiceInterval computeServiceInterval(
      HasBlockTrips blockIndex, int blockSequence) {

    ServiceInterval serviceInterval = null;

    List<BlockTripEntry> trips = blockIndex.getTrips();

    for (BlockTripEntry trip : trips) {

View Full Code Here


    return endTimes;
  }

  public ServiceInterval getRange() {
    int n = startTimes.length - 1;
    return new ServiceInterval(startTimes[0], startTimes[0], endTimes[n],
        endTimes[n]);
  }
View Full Code Here

        stopIndex);

    StopTimeEntry fromSt = fromBst.getStopTime();
    StopTimeEntry toSt = toBst.getStopTime();

    return new ServiceInterval(fromSt.getArrivalTime(),
        fromSt.getDepartureTime(), toSt.getArrivalTime(),
        toSt.getDepartureTime());
  }
View Full Code Here

    int index = 0;

    for (T entry : entries) {

      ServiceInterval interval = null;

      List<BlockStopTimeEntry> stopTimes = entry.getStopTimes();
      StopTimeEntry first = stopTimes.get(0).getStopTime();
      StopTimeEntry last = stopTimes.get(stopTimes.size() - 1).getStopTime();
      interval = extend(interval, first);
      interval = extend(interval, last);

      minArrivals[index] = interval.getMinArrival();
      minDepartures[index] = interval.getMinDeparture();
      maxArrivals[index] = interval.getMaxArrival();
      maxDepartures[index] = interval.getMaxDeparture();

      index++;
    }

    return new ServiceIntervalBlock(minArrivals, minDepartures, maxArrivals,
View Full Code Here

  }

  private ServiceInterval extend(ServiceInterval interval,
      StopTimeEntry stopTime) {
    if (interval == null)
      return new ServiceInterval(stopTime.getArrivalTime(),
          stopTime.getDepartureTime());
    return interval.extend(stopTime.getArrivalTime(),
        stopTime.getDepartureTime());
  }
View Full Code Here

    List<BlockConfigurationEntry> blockConfigs = new ArrayList<BlockConfigurationEntry>(
        n);
    int[] stopIndices = new int[n];

    ServiceInterval interval = null;

    for (int i = 0; i < n; i++) {
      BlockStopTimeEntry blockStopTime = group.get(i);
      StopTimeEntry stopTime = blockStopTime.getStopTime();
      blockConfigs.add(blockStopTime.getTrip().getBlockConfiguration());
View Full Code Here

    List<FrequencyEntry> frequencies = new ArrayList<FrequencyEntry>(n);
    List<BlockConfigurationEntry> blockConfigs = new ArrayList<BlockConfigurationEntry>(
        n);
    int[] stopIndices = new int[n];

    ServiceInterval interval = null;

    for (int i = 0; i < n; i++) {
      FrequencyBlockStopTimeEntry frequencyBlockStopTime = group.get(i);
      FrequencyEntry frequency = frequencyBlockStopTime.getFrequency();
      frequencies.add(frequency);
View Full Code Here

      Date timeFrom, Date timeTo, Collection<BlockInstance> instances) {

    List<BlockTripEntry> trips = index.getTrips();

    ServiceIntervalBlock serviceIntervalBlock = index.getServiceIntervalBlock();
    ServiceInterval serviceInterval = serviceIntervalBlock.getRange();

    Collection<Date> serviceDates = _calendarService.getServiceDatesWithinRange(
        index.getServiceIds(), serviceInterval, timeFrom, timeTo);

    for (Date serviceDate : serviceDates) {
View Full Code Here

      Date timeFrom, Date timeTo, Collection<BlockInstance> instances) {

    List<BlockTripEntry> trips = index.getTrips();

    LayoverIntervalBlock layoverIntervalBlock = index.getLayoverIntervalBlock();
    ServiceInterval serviceInterval = layoverIntervalBlock.getRange();

    Collection<Date> serviceDates = _calendarService.getServiceDatesWithinRange(
        index.getServiceIds(), serviceInterval, timeFrom, timeTo);

    for (Date serviceDate : serviceDates) {
View Full Code Here

    List<BlockTripEntry> trips = index.getTrips();
    List<FrequencyEntry> frequencies = index.getFrequencies();

    FrequencyServiceIntervalBlock serviceIntervalBlock = index.getServiceIntervalBlock();
    ServiceInterval serviceInterval = serviceIntervalBlock.getRange();

    Collection<Date> serviceDates = _calendarService.getServiceDatesWithinRange(
        index.getServiceIds(), serviceInterval, timeFrom, timeTo);

    for (Date serviceDate : serviceDates) {
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs.model.calendar.ServiceInterval

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.