本文整理匯總了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