本文整理汇总了Java中com.thales.ntis.subscriber.datex.MeasuredDataPublication类的典型用法代码示例。如果您正苦于以下问题:Java MeasuredDataPublication类的具体用法?Java MeasuredDataPublication怎么用?Java MeasuredDataPublication使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MeasuredDataPublication类属于com.thales.ntis.subscriber.datex包,在下文中一共展示了MeasuredDataPublication类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handle
import com.thales.ntis.subscriber.datex.MeasuredDataPublication; //导入依赖的package包/类
@Override
public void handle(D2LogicalModel d2LogicalModel) {
LOG.info("handling TMU Request !");
try {
if (d2LogicalModel.getPayloadPublication() != null) {
List<SiteMeasurements> siteMeasurementsList = ((MeasuredDataPublication) d2LogicalModel.getPayloadPublication())
.getSiteMeasurements();
for (SiteMeasurements siteMeasurements : siteMeasurementsList) {
List<SiteMeasurementsIndexMeasuredValue> measuredValueList = siteMeasurements.getMeasuredValue();
for (SiteMeasurementsIndexMeasuredValue siteMeasurementsIndexMeasuredValue : measuredValueList) {
MeasuredValue measuredValue = siteMeasurementsIndexMeasuredValue.getMeasuredValue();
BasicData basicData = measuredValue.getBasicData();
if (basicData instanceof TrafficFlow) {
VehicleFlowValue value = ((TrafficFlow) basicData).getVehicleFlow();
LOG.info("Vehicle flow rate : " + value.getVehicleFlowRate().intValue());
} else if (basicData instanceof TrafficSpeed) {
float speed = ((TrafficSpeed) basicData).getAverageVehicleSpeed().getSpeed();
LOG.info("Traffic speed : " + speed);
} else if (basicData instanceof TrafficHeadway) {
float headWay = ((TrafficHeadway) basicData).getAverageTimeHeadway().getDuration();
LOG.info("Traffic Headway : " + headWay);
} else if (basicData instanceof TrafficConcentration) {
float percentage = ((TrafficConcentration) basicData).getOccupancy().getPercentage();
LOG.info("Traffic concentration percentage : " + percentage);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
LOG.error(e.getMessage());
}
LOG.info("TMU Request: Processing Completed Successfuly");
}
开发者ID:ntisservices,项目名称:OBSOLETE-ntis-java-web-services-Release2.4,代码行数:36,代码来源:TMUTrafficDataServiceImpl.java