Package org.onebusaway.transit_data.model.blocks

Examples of org.onebusaway.transit_data.model.blocks.BlockConfigurationBean


    bean.setId(AgencyAndIdLibrary.convertToString(blockEntry.getId()));

    List<BlockConfigurationBean> configBeans = new ArrayList<BlockConfigurationBean>();
    for (BlockConfigurationEntry blockConfiguration : blockEntry.getConfigurations()) {
      BlockConfigurationBean configBean = getBlockConfigurationAsBean(blockConfiguration);
      configBeans.add(configBean);
    }
    bean.setConfigurations(configBeans);

    return bean;
View Full Code Here


  private BlockInstanceBean getBlockInstanceAsBean(BlockInstance blockInstance) {

    BlockInstanceBean bean = new BlockInstanceBean();

    BlockConfigurationBean blockConfig = getBlockConfigurationAsBean(blockInstance.getBlock());
    bean.setBlockId(blockConfig.getBlockId());
    bean.setBlockConfiguration(blockConfig);

    long serviceDate = blockInstance.getServiceDate();
    bean.setServiceDate(serviceDate);
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())
      tripBeans.add(getBlockTripAsBean(blockTrip));
    bean.setTrips(tripBeans);

    TimeZone tz = _agencyService.getTimeZoneForAgencyId(blockId.getAgencyId());
    bean.setTimeZone(tz.getID());

    return bean;
  }
View Full Code Here

    _blockInstance = _service.getBlockInstance(_id, _serviceDate.getTime());

    if (_blockInstance == null)
      return ERROR;

    BlockConfigurationBean blockConfig = _blockInstance.getBlockConfiguration();
    _timeZone = TimeZone.getTimeZone(blockConfig.getTimeZone());

    return SUCCESS;
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.blocks.BlockConfigurationBean

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.