use of org.opennms.newts.api.query.Calculation in project newts by OpenNMS.
the class Compute method next.
@Override
public Row<Measurement> next() {
if (!hasNext())
throw new NoSuchElementException();
Row<Measurement> row = m_input.next();
for (Calculation calc : m_resultDescriptor.getCalculations().values()) {
double v = calc.getCalculationFunction().apply(getValues(row, calc.getArgs()));
row.addElement(new Measurement(row.getTimestamp(), row.getResource(), calc.getLabel(), v));
}
return row;
}
Aggregations