}
EnumMap<AggregationFunction, Number> results = new EnumMap<AggregationFunction, Number>(AggregationFunction.class);
if (singlePass != null && singlePass) {
AggregateFeatureCalc calc = new AggregateFeatureCalc(visitors);
features.accepts(calc, new NullProgressListener());
List<CalcResult> resultList = (List<CalcResult>) calc.getResult().getValue();
for (int i = 0; i < functionList.size(); i++) {
CalcResult result = resultList.get(i);
if(result != null) {
results.put(functionList.get(i), (Number) result.getValue());
}
}
} else {
for (int i = 0; i < functionList.size(); i++) {
final FeatureCalc calc = visitors.get(i);
features.accepts(calc, new NullProgressListener());
results.put(functionList.get(i), (Number) calc.getResult().getValue());
}
}
return new Results(results);