Search in sources :

Example 1 with BlockTripV2Bean

use of org.onebusaway.api.model.transit.blocks.BlockTripV2Bean in project onebusaway-application-modules by camsys.

the class BeanFactoryV2 method getBlockTrip.

public BlockTripV2Bean getBlockTrip(BlockTripBean blockTrip) {
    BlockTripV2Bean bean = new BlockTripV2Bean();
    bean.setAccumulatedSlackTime(blockTrip.getAccumulatedSlackTime());
    bean.setDistanceAlongBlock(blockTrip.getDistanceAlongBlock());
    addToReferences(blockTrip.getTrip());
    bean.setTripId(blockTrip.getTrip().getId());
    List<BlockStopTimeV2Bean> blockStopTimes = new ArrayList<BlockStopTimeV2Bean>();
    for (BlockStopTimeBean blockStopTime : blockTrip.getBlockStopTimes()) {
        BlockStopTimeV2Bean stopTimeBean = getBlockStopTime(blockStopTime);
        blockStopTimes.add(stopTimeBean);
    }
    bean.setBlockStopTimes(blockStopTimes);
    return bean;
}
Also used : BlockStopTimeV2Bean(org.onebusaway.api.model.transit.blocks.BlockStopTimeV2Bean) ArrayList(java.util.ArrayList) BlockTripV2Bean(org.onebusaway.api.model.transit.blocks.BlockTripV2Bean) BlockStopTimeBean(org.onebusaway.transit_data.model.blocks.BlockStopTimeBean)

Example 2 with BlockTripV2Bean

use of org.onebusaway.api.model.transit.blocks.BlockTripV2Bean in project onebusaway-application-modules by camsys.

the class BeanFactoryV2 method getBlockConfig.

public BlockConfigurationV2Bean getBlockConfig(BlockConfigurationBean blockConfig) {
    BlockConfigurationV2Bean bean = new BlockConfigurationV2Bean();
    bean.setActiveServiceIds(blockConfig.getActiveServiceIds());
    bean.setInactiveServiceIds(blockConfig.getInactiveServiceIds());
    List<BlockTripV2Bean> blockTrips = new ArrayList<BlockTripV2Bean>();
    for (BlockTripBean blockTrip : blockConfig.getTrips()) blockTrips.add(getBlockTrip(blockTrip));
    bean.setTrips(blockTrips);
    return bean;
}
Also used : BlockTripBean(org.onebusaway.transit_data.model.blocks.BlockTripBean) ArrayList(java.util.ArrayList) BlockTripV2Bean(org.onebusaway.api.model.transit.blocks.BlockTripV2Bean) BlockConfigurationV2Bean(org.onebusaway.api.model.transit.blocks.BlockConfigurationV2Bean)

Aggregations

ArrayList (java.util.ArrayList)2 BlockTripV2Bean (org.onebusaway.api.model.transit.blocks.BlockTripV2Bean)2 BlockConfigurationV2Bean (org.onebusaway.api.model.transit.blocks.BlockConfigurationV2Bean)1 BlockStopTimeV2Bean (org.onebusaway.api.model.transit.blocks.BlockStopTimeV2Bean)1 BlockStopTimeBean (org.onebusaway.transit_data.model.blocks.BlockStopTimeBean)1 BlockTripBean (org.onebusaway.transit_data.model.blocks.BlockTripBean)1