当前位置: 首页>>代码示例>>Java>>正文


Java ElaboratedData类代码示例

本文整理汇总了Java中com.thales.ntis.subscriber.datex.ElaboratedData的典型用法代码示例。如果您正苦于以下问题:Java ElaboratedData类的具体用法?Java ElaboratedData怎么用?Java ElaboratedData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ElaboratedData类属于com.thales.ntis.subscriber.datex包,在下文中一共展示了ElaboratedData类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractTrafficDataFromElaboratedData

import com.thales.ntis.subscriber.datex.ElaboratedData; //导入依赖的package包/类
private void extractTrafficDataFromElaboratedData(ElaboratedData dataItem) {

        // Location is always specified as LocationByReference (referenced to a
        // single Network Link)
        LocationByReference location = (LocationByReference) dataItem.getBasicData().getPertinentLocation();
        LOG.info("Data for Network Link: " + location.getPredefinedLocationReference().getId());

        BasicData basicData = dataItem.getBasicData();

        // Determine what class (type) of traffic data is contained in the basic
        // data
        if (TrafficSpeed.class.equals(basicData.getClass())) {
            TrafficSpeed speed = (TrafficSpeed) basicData;
            LOG.info("Average Speed: " + speed.getAverageVehicleSpeed().getSpeed());

        } else if (TravelTimeData.class.equals(basicData.getClass())) {
            TravelTimeData travelTimeData = (TravelTimeData) basicData;
            LOG.info("Travel Time: " + travelTimeData.getTravelTime().getDuration());
            LOG.info("Free Flow Travel Time: " + travelTimeData.getFreeFlowTravelTime().getDuration());
            LOG.info("Normally Expected Travel Time: " + travelTimeData.getNormallyExpectedTravelTime().getDuration());

        } else if (TrafficFlow.class.equals(basicData.getClass())) {
            TrafficFlow flow = (TrafficFlow) basicData;
            LOG.info("Traffic Flow: " + flow.getVehicleFlow().getVehicleFlowRate());

        } else if (TrafficConcentration.class.equals(basicData.getClass())) {
            TrafficConcentration concentration = (TrafficConcentration) basicData;
            LOG.info("Occupancy (%age): " + concentration.getOccupancy().getPercentage());

        } else if (TrafficHeadway.class.equals(basicData.getClass())) {
            TrafficHeadway headway = (TrafficHeadway) basicData;
            LOG.info("Headway: " + headway.getAverageTimeHeadway().getDuration());

        } else {
            LOG.error("Unexpected traffic data type contained in publication: " + dataItem.getClass().getSimpleName());
        }
    }
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:38,代码来源:FusedSensorOnlyTrafficDataServiceImpl.java

示例2: getElaboratedDataListFor

import com.thales.ntis.subscriber.datex.ElaboratedData; //导入依赖的package包/类
private List<ElaboratedData> getElaboratedDataListFor(List<ElaboratedData> payLoadElaboratedDataList,
        Class<?> clazz) {
    List<ElaboratedData> edList = new ArrayList<ElaboratedData>();
    for (ElaboratedData ed : payLoadElaboratedDataList) {
        if (ed.getBasicData().getClass().equals(clazz)) {
            edList.add(ed);
        }
    }
    return edList;
}
 
开发者ID:ntisservices,项目名称:OBSOLETE-ntis-java-web-services-Release2.4,代码行数:11,代码来源:FVDTrafficDataServiceImpl.java

示例3: extractTrafficDataFromElaboratedData

import com.thales.ntis.subscriber.datex.ElaboratedData; //导入依赖的package包/类
private void extractTrafficDataFromElaboratedData(ElaboratedData dataItem) {

        // Location is always specified as LocationByReference (referenced to a
        // single Network Link)
        LocationByReference location = (LocationByReference) dataItem.getBasicData().getPertinentLocation();
        LOG.info("Data for Network Link: " + location.getPredefinedLocationReference().getId());
        
        BasicData basicData = dataItem.getBasicData();

        // Determine what class (type) of traffic data is contained in the basic data
        if (TrafficSpeed.class.equals(basicData.getClass())) {
            TrafficSpeed speed = (TrafficSpeed)basicData;
            
            // There are 2 types of speed data - current and forecast, determined by 
            // whether a measurementOrCalculationTime element exists in the data item.
            if(speed.getMeasurementOrCalculationTime() == null) {
                LOG.info("Fused Average Speed: " + speed.getAverageVehicleSpeed().getSpeed());
                LOG.info("FVD-Only Average Speed: " + speed.getTrafficSpeedExtension().getSpeedFvdOnly().getSpeed());
            } else {
                LOG.info("Fused Average Speed (forecast for " + speed.getMeasurementOrCalculationTime().toString() + "): "
                        + speed.getAverageVehicleSpeed().getSpeed());
            }
            
        } else if (TravelTimeData.class.equals(basicData.getClass())) {
                TravelTimeData travelTimeData = (TravelTimeData)basicData;

            // There are 2 types of travel time data - current and forecast,
            // determined by whether a measurementOrCalculationTime element
            // exists in the data item.
            if (travelTimeData.getMeasurementOrCalculationTime() == null) {
                LOG.info("Travel Time: " + travelTimeData.getTravelTime().getDuration());
                LOG.info("Free Flow Travel Time: " + travelTimeData.getFreeFlowTravelTime().getDuration());
                LOG.info("Normally Expected Travel Time: " + travelTimeData.getNormallyExpectedTravelTime().getDuration());
            } else {
                LOG.info("Travel Time (forecast for " + travelTimeData.getMeasurementOrCalculationTime().toString() + "): "
                        + travelTimeData.getTravelTime().getDuration());
            }

        } else {
            LOG.error("Unexpected traffic data type contained in publication: " + dataItem.getClass().getSimpleName());
        }
    }
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:43,代码来源:FusedFvdAndSensorTrafficDataServiceImpl.java


注:本文中的com.thales.ntis.subscriber.datex.ElaboratedData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。