Package org.onebusaway.transit_data_federation.services.transit_graph

Examples of org.onebusaway.transit_data_federation.services.transit_graph.ServiceIdActivation


        if (isSubset(activeServiceIds, combo2))
          inactiveServiceIds.addAll(combo2);
      }
      inactiveServiceIds.removeAll(activeServiceIds);
     
      combinations.add(new ServiceIdActivation(list(activeServiceIds),
          list(inactiveServiceIds)));
    }

    Collections.sort(combinations);
View Full Code Here


    List<FrequencyBlockStopTimeIndex> frequencyIndices = _blockIndexService.getFrequencyStopTimeIndicesForStop(stop);
    for (FrequencyBlockStopTimeIndex index : frequencyIndices)
      allServiceIds.add(index.getServiceIds());

    for (Iterator<ServiceIdActivation> it = allServiceIds.iterator(); it.hasNext();) {
      ServiceIdActivation activation = it.next();
      LocalizedServiceId lsid = activation.getActiveServiceIds().get(0);
      String agencyId = lsid.getId().getAgencyId();
      AgencyBean bean = _agencyBeanService.getAgencyForId(agencyId);
      if (bean.isPrivateService() && !includePrivateService)
        it.remove();
    }
View Full Code Here

  private BlockConfigurationBean getBlockConfigurationAsBean(
      BlockConfigurationEntry blockConfiguration) {

    BlockConfigurationBean bean = new BlockConfigurationBean();
    ServiceIdActivation serviceIds = blockConfiguration.getServiceIds();

    AgencyAndId blockId = blockConfiguration.getBlock().getId();
    bean.setBlockId(AgencyAndIdLibrary.convertToString(blockId));

    List<String> activeServiceIds = new ArrayList<String>();
    for (LocalizedServiceId lsid : serviceIds.getActiveServiceIds())
      activeServiceIds.add(AgencyAndIdLibrary.convertToString(lsid.getId()));
    bean.setActiveServiceIds(activeServiceIds);

    List<String> inactiveServiceIds = new ArrayList<String>();
    for (LocalizedServiceId lsid : serviceIds.getInactiveServiceIds())
      inactiveServiceIds.add(AgencyAndIdLibrary.convertToString(lsid.getId()));
    bean.setInactiveServiceIds(inactiveServiceIds);

    List<BlockTripBean> tripBeans = new ArrayList<BlockTripBean>();
    for (BlockTripEntry blockTrip : blockConfiguration.getTrips())
View Full Code Here

  }

  @Test
  public void testGetServiceDatesWithinRange01() {

    ServiceIdActivation serviceIds = serviceIds(lsids("sA"), lsids("sB"));

    Date from = UnitTestingSupport.date("2010-09-10 09:30");
    Date to = UnitTestingSupport.date("2010-09-10 10:30");

    Collection<Date> dates = _service.getServiceDatesWithinRange(serviceIds,
View Full Code Here

  }

  @Test
  public void testGetServiceDatesForServiceIds01() {

    ServiceIdActivation serviceIds = serviceIds(lsids("sA"), lsids("sB"));

    Set<Date> dates = _service.getDatesForServiceIds(serviceIds);

    assertEquals(1, dates.size());
    assertTrue(dates.contains(new ServiceDate(2010, 9, 10).getAsDate(timeZone())));
View Full Code Here

  }

  @Test
  public void testGetServiceDatesWithinRange02() {

    ServiceIdActivation serviceIds = serviceIds(lsids("sA", "sB"), lsids());

    Date from = UnitTestingSupport.date("2010-09-11 09:30");
    Date to = UnitTestingSupport.date("2010-09-11 10:30");

    Collection<Date> dates = _service.getServiceDatesWithinRange(serviceIds,
View Full Code Here

  }

  @Test
  public void testGetServiceDatesForServiceIds02() {

    ServiceIdActivation serviceIds = serviceIds(lsids("sA", "sB"), lsids());

    Set<Date> dates = _service.getDatesForServiceIds(serviceIds);

    assertEquals(1, dates.size());
    assertTrue(dates.contains(new ServiceDate(2010, 9, 11).getAsDate(timeZone())));
View Full Code Here

  }

  @Test
  public void testGetServiceDatesWithinRange03() {

    ServiceIdActivation serviceIds = serviceIds(lsids("sC", "sD"), lsids());

    Date from = UnitTestingSupport.date("2010-09-13 09:30");
    Date to = UnitTestingSupport.date("2010-09-13 10:30");

    Collection<Date> dates = _service.getServiceDatesWithinRange(serviceIds,
View Full Code Here

  }

  @Test
  public void testGetServiceDatesForServiceIds03() {

    ServiceIdActivation serviceIds = serviceIds(lsids("sC", "sD"), lsids());

    Set<Date> dates = _service.getDatesForServiceIds(serviceIds);

    assertEquals(1, dates.size());
    assertTrue(dates.contains(new ServiceDate(2010, 9, 13).getAsDate(timeZone())));
View Full Code Here

  }

  @Test
  public void testGetServiceDatesWithinRange04() {

    ServiceIdActivation serviceIds = serviceIds(lsids("sA", "sC"), lsids());

    Date from = UnitTestingSupport.date("2010-09-10 09:30");
    Date to = UnitTestingSupport.date("2010-09-10 10:30");

    Collection<Date> dates = _service.getServiceDatesWithinRange(serviceIds,
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.transit_graph.ServiceIdActivation

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.