Package org.onebusaway.transit_data_federation.impl.transit_graph.BlockConfigurationEntryImpl

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockConfigurationEntryImpl.Builder


      trip.setBlock(block);
      tripEntries.add(trip);
      if (trip.getServiceId() != null)
        serviceIds.add(trip.getServiceId());
    }
    Builder builder = BlockConfigurationEntryImpl.builder();
    builder.setBlock(block);
    builder.setServiceIds(new ServiceIdActivation(
        new ArrayList<LocalizedServiceId>(serviceIds),
        new ArrayList<LocalizedServiceId>()));
    builder.setTrips(tripEntries);
    builder.setFrequencies(frequencies);
    builder.setTripGapDistances(new double[tripEntries.size()]);

    BlockConfigurationEntry configuration = builder.create();

    List<BlockConfigurationEntry> configurations = block.getConfigurations();
    if (configurations == null) {
      configurations = new ArrayList<BlockConfigurationEntry>();
      block.setConfigurations(configurations);
View Full Code Here


    return stopTime(id, stop, trip, time, time, shapeDistTraveled);
  }

  public static BlockConfigurationEntry blockConfiguration(BlockEntry block,
      ServiceIdActivation serviceIds, TripEntry... trips) {
    Builder builder = BlockConfigurationEntryImpl.builder();
    builder.setBlock(block);
    builder.setServiceIds(serviceIds);
    builder.setTrips(Arrays.asList(trips));
    builder.setTripGapDistances(new double[trips.length]);
    BlockConfigurationEntry blockConfig = builder.create();

    BlockEntryImpl blockImpl = (BlockEntryImpl) block;
    List<BlockConfigurationEntry> configs = block.getConfigurations();
    if (configs == null) {
      configs = new ArrayList<BlockConfigurationEntry>();
View Full Code Here

    List<TripEntry> tripsInBlock = new ArrayList<TripEntry>();
    for (TripEntryImpl trip : trips)
      tripsInBlock.add(trip);

    Builder builder = BlockConfigurationEntryImpl.builder();
    builder.setBlock(block);
    builder.setTripGapDistances(new double[tripsInBlock.size()]);
    builder.setServiceIds(serviceIds);
    builder.setTrips(tripsInBlock);

    BlockConfigurationEntry config = builder.create();
    List<BlockConfigurationEntry> configs = block.getConfigurations();
    if (configs == null) {
      configs = new ArrayList<BlockConfigurationEntry>();
      block.setConfigurations(configs);
    }
View Full Code Here

    StopTimeEntryImpl st5 = stopTime(5, stopA, tripC, time(8, 30), time(8, 35),
        300);
    StopTimeEntryImpl st6 = stopTime(6, stopB, tripC, time(9, 00), time(9, 02),
        1200);

    Builder builder = BlockConfigurationEntryImpl.builder();
    builder.setBlock(block);
    builder.setTrips(trips);
    builder.setServiceIds(serviceIds);
    builder.setTripGapDistances(new double[] {10.0, 20.0, 0.0});
    BlockConfigurationEntry entry = builder.create();

    assertSame(block, entry.getBlock());
    assertSame(serviceIds, entry.getServiceIds());

    assertEquals(4530.0, entry.getTotalBlockDistance(), 0.0);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.impl.transit_graph.BlockConfigurationEntryImpl.Builder

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.