Package org.onebusaway.transit_data_federation.services.blocks

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


    fromIndicesBySequence.keySet().retainAll(toIndicesBySequence.keySet());

    List<Pair<BlockStopSequenceIndex>> results = new ArrayList<Pair<BlockStopSequenceIndex>>();

    for (Map.Entry<BlockSequenceIndex, BlockStopSequenceIndex> entry : fromIndicesBySequence.entrySet()) {
      BlockSequenceIndex index = entry.getKey();
      BlockStopSequenceIndex fromStopIndex = entry.getValue();
      BlockStopSequenceIndex toStopIndex = toIndicesBySequence.get(index);

      /**
       * If the stops aren't in the requested order, then we don't include the
View Full Code Here


    BlockConfigurationEntry b1A = linkBlockTrips("b1A", trip1A);
    BlockConfigurationEntry b1B = linkBlockTrips("b1B", trip1B);
    BlockConfigurationEntry b1C = linkBlockTrips("b1C", trip1C);
    BlockConfigurationEntry b1D = linkBlockTrips("b1D", trip1D);

    BlockSequenceIndex index1 = createBlockSequenceIndex(b1A, b1B, b1C, b1D);
    BlockStopSequenceIndex fromIndex1 = new BlockStopSequenceIndex(index1, 0);
    BlockStopSequenceIndex toIndex1 = new BlockStopSequenceIndex(index1, 1);

    Pair<BlockStopSequenceIndex> indexPair1 = Tuples.pair(fromIndex1, toIndex1);

    TripEntryImpl trip2A = trip("2A", "sA");
    TripEntryImpl trip2B = trip("2B", "sA");
    TripEntryImpl trip2C = trip("2C", "sA");
    TripEntryImpl trip2D = trip("2D", "sA");

    stopTime(0, fromStop, trip2A, time(10, 07), time(10, 07), 0.0);
    stopTime(1, fromStop, trip2B, time(10, 17), time(10, 17), 0.0);
    stopTime(2, fromStop, trip2C, time(10, 27), time(10, 27), 0.0);
    stopTime(3, fromStop, trip2D, time(10, 37), time(10, 37), 0.0);

    stopTime(4, toStop, trip2A, time(10, 17), time(10, 17), 0.0);
    stopTime(5, toStop, trip2B, time(10, 27), time(10, 27), 0.0);
    stopTime(6, toStop, trip2C, time(10, 37), time(10, 37), 0.0);
    stopTime(7, toStop, trip2D, time(10, 47), time(10, 47), 0.0);

    BlockConfigurationEntry b2A = linkBlockTrips("bA", trip2A);
    BlockConfigurationEntry b2B = linkBlockTrips("bB", trip2B);
    BlockConfigurationEntry b2C = linkBlockTrips("bC", trip2C);
    BlockConfigurationEntry b2D = linkBlockTrips("bD", trip2D);

    BlockSequenceIndex index2 = createBlockSequenceIndex(b2A, b2B, b2C, b2D);
    BlockStopSequenceIndex fromIndex2 = new BlockStopSequenceIndex(index2, 0);
    BlockStopSequenceIndex toIndex2 = new BlockStopSequenceIndex(index2, 1);

    Pair<BlockStopSequenceIndex> indexPair2 = Tuples.pair(fromIndex2, toIndex2);
View Full Code Here

      List<List<BlockSequence>> groupedBlocks = BlockLibrary.createStrictlyOrderedGroups(
          sequences, _blockSequenceLooseComparator,
          _blockSequenceStrictComparator);

      for (List<BlockSequence> group : groupedBlocks) {
        BlockSequenceIndex index = createSequenceIndexForGroupOfBlockSequences(group);
        allIndices.add(index);
      }
    }

    return allIndices;
View Full Code Here

  public BlockSequenceIndex createSequenceIndexForGroupOfBlockSequences(
      List<BlockSequence> sequences) {
    ServiceIntervalBlock serviceIntervalBlock = getBlockStopTimesAsBlockInterval(sequences);
    String agencyId = sequences.get(0).getBlockConfig().getBlock().getId().getAgencyId();
    boolean privateService = _privateAgencyIds.contains(agencyId);
    return new BlockSequenceIndex(sequences, serviceIntervalBlock,
        privateService);
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.blocks.BlockSequenceIndex

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.