Package org.onebusaway.transit_data.model.blocks

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


  private ListBean<BlockStatusBean> beans(List<BlockLocation> locations) {

    List<BlockStatusBean> results = new ArrayList<BlockStatusBean>();

    for (BlockLocation location : locations) {
      BlockStatusBean statusBean = bean(location);
      if (statusBean != null)
        results.add(statusBean);
    }

    return new ListBean<BlockStatusBean>(results, false);
View Full Code Here


    BlockInstance instance = blockLocation.getBlockInstance();
    BlockConfigurationEntry block = instance.getBlock();
    long serviceDate = instance.getServiceDate();

    BlockStatusBean bean = new BlockStatusBean();

    bean.setBlock(_blockBeanService.getBlockForId(block.getBlock().getId()));

    bean.setStatus("default");
    bean.setServiceDate(serviceDate);
    bean.setTotalDistanceAlongBlock(block.getTotalBlockDistance());

    bean.setInService(blockLocation.isInService());

    CoordinatePoint location = blockLocation.getLocation();
    bean.setLocation(location);

    bean.setScheduledDistanceAlongBlock(blockLocation.getScheduledDistanceAlongBlock());
    bean.setDistanceAlongBlock(blockLocation.getDistanceAlongBlock());
   
    BlockTripEntry activeTrip = blockLocation.getActiveTrip();
    if (activeTrip != null) {
      BlockTripBean activeTripBean = _blockBeanService.getBlockTripAsBean(activeTrip);
      bean.setActiveTrip(activeTripBean);
    }

    BlockStopTimeEntry stop = blockLocation.getClosestStop();
    if (stop != null) {
      StopBean stopBean = _stopBeanService.getStopForId(stop.getStopTime().getStop().getId());
      bean.setClosestStop(stopBean);
      bean.setClosestStopTimeOffset(blockLocation.getClosestStopTimeOffset());
    }

    bean.setPredicted(blockLocation.isPredicted());
    bean.setLastUpdateTime(blockLocation.getLastUpdateTime());
    bean.setScheduleDeviation(blockLocation.getScheduleDeviation());

    AgencyAndId vid = blockLocation.getVehicleId();
    if (vid != null)
      bean.setVehicleId(ApplicationBeanLibrary.getId(vid));

    return bean;
  }
View Full Code Here

TOP

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

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.