Package org.onebusaway.transit_data_federation.services.blocks

Examples of org.onebusaway.transit_data_federation.services.blocks.FrequencyServiceIntervalBlock


    ServiceIdActivation serviceIds = index.getServiceIds();
    assertEquals(1, serviceIds.getActiveServiceIds().size());
    assertTrue(serviceIds.getActiveServiceIds().contains(lsid("s1")));

    FrequencyServiceIntervalBlock intervalBlock = index.getServiceIntervalBlock();
    assertTrue(Arrays.equals(new int[] {
        time(6, 0), time(9, 0), time(15, 0), time(18, 0)},
        intervalBlock.getStartTimes()));
    assertTrue(Arrays.equals(new int[] {
        time(9, 0), time(15, 0), time(18, 0), time(21, 0)},
        intervalBlock.getEndTimes()));
  }
View Full Code Here


    ServiceIdActivation serviceIds = index.getServiceIds();
    assertEquals(1, serviceIds.getActiveServiceIds().size());
    assertTrue(serviceIds.getActiveServiceIds().contains(lsid("s1")));

    FrequencyServiceIntervalBlock intervalBlock = index.getServiceIntervalBlock();
    assertTrue(Arrays.equals(new int[] {time(6, 0), time(15, 0)},
        intervalBlock.getStartTimes()));
    assertTrue(Arrays.equals(new int[] {time(9, 0), time(18, 0)},
        intervalBlock.getEndTimes()));

    /****
     *
     ****/

    indices = grep(allIndices, aid("b"));
    assertEquals(1, indices.size());

    index = indices.get(0);

    trips = trips(index.getTrips());
    assertEquals(2, trips.size());
    assertEquals(tripB, trips.get(0));
    assertEquals(tripB, trips.get(1));

    freqs = index.getFrequencies();
    assertEquals(Arrays.asList(freqB1, freqB2), freqs);

    serviceIds = index.getServiceIds();
    assertEquals(1, serviceIds.getActiveServiceIds().size());
    assertTrue(serviceIds.getActiveServiceIds().contains(lsid("s1")));

    intervalBlock = index.getServiceIntervalBlock();
    assertTrue(Arrays.equals(new int[] {time(8, 0), time(17, 0)},
        intervalBlock.getStartTimes()));
    assertTrue(Arrays.equals(new int[] {time(14, 0), time(20, 0)},
        intervalBlock.getEndTimes()));
  }
View Full Code Here

      for (BlockTripEntry entry : index.getTrips()) {
        BlockTripReference reference = ReferencesLibrary.getTripAsReference(entry);
        tripReferences.add(reference);
      }

      FrequencyServiceIntervalBlock serviceIntervalBlock = index.getServiceIntervalBlock();

      FrequencyBlockTripIndexData data = new FrequencyBlockTripIndexData(
          tripReferences, index.getFrequencies(), serviceIntervalBlock);
      allData.add(data);
    }
View Full Code Here

    return new BlockLayoverIndex(trips, layoverIntervalBlock);
  }

  public FrequencyBlockTripIndex createFrequencyIndexForTrips(
      List<BlockTripEntry> trips, List<FrequencyEntry> frequencies) {
    FrequencyServiceIntervalBlock serviceIntervalBlock = getBlockTripsAsFrequencyBlockInterval(
        trips, frequencies);
    return new FrequencyBlockTripIndex(trips, frequencies, serviceIntervalBlock);
  }
View Full Code Here

      startTimes[index] = freq.getStartTime();
      endTimes[index] = freq.getEndTime();
    }

    return new FrequencyServiceIntervalBlock(startTimes, endTimes);
  }
View Full Code Here

      Collection<BlockInstance> instances) {

    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.transit_data_federation.services.blocks.FrequencyServiceIntervalBlock

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.