final Element ele = (Element) HelperAttributes.javaType2Attribute(object);
Element leftHandSide = (Element) HelperAttributes.javaType2Attribute(obj); Boolean evaluation = HelperCOM.evaluateExpression(leftHandSide, compositeFilter.getType(), compositeFilter.getFieldValue());
private StatisticValue generateStatisticValueMeanAverage(long paramIdentityId, TimeList times, AttributeValueList values) { StatisticValue statValue = this.newStatisticValue(paramIdentityId, times, values); if (statValue == null) { return null; } //----------------------Mean Calculation-------------------------- double mean = 0; // Go through all the data sets and find the maximum value... for (int i = 0; i < values.size(); i++) { if (values.get(i) == null) { continue; } mean += HelperAttributes.attribute2double(values.get(i).getValue()); } mean = mean / ((double) values.size()); //---------------------------------------------------------------- //requirement: 3.6.3.j report double value statValue.setValue((Attribute) HelperAttributes.javaType2Attribute(new Double(mean))); statValue.setValueTime(null); // StatisticValue structure: "Shall be NULL if not applicable for cases such as 'mean average'." return statValue; }
private StatisticValue generateStatisticValueStandardDeviation(long paramIdentityId, TimeList times, AttributeValueList values) { StatisticValue statValue = this.newStatisticValue(paramIdentityId, times, values); if (statValue == null) { return null; } //----------------------Mean Calculation-------------------------- double mean = 0; // Go through all the data sets and find the maximum value... for (int i = 0; i < values.size(); i++) { if (values.get(i) == null) { continue; } mean += HelperAttributes.attribute2double(values.get(i).getValue()); } mean = mean / ((double) values.size()); //---------------------------------------------------------------- double variance = 0; // Go through all the data sets and find the maximum value... for (int i = 0; i < values.size(); i++) { double tmp = HelperAttributes.attribute2double(values.get(i).getValue()) - mean; variance += Math.pow(tmp, 2); } variance = variance / ((double) (values.size() - 1)); variance = Math.sqrt(variance); //requirement: 3.6.3.k report double value statValue.setValue((Attribute) HelperAttributes.javaType2Attribute(new Double(variance))); statValue.setValueTime(null); // StatisticValue structure: "Shall be NULL if not applicable for cases such as 'mean average'." return statValue; }