switch(event) {
case average:
partial = new PartialAverage(scale);
break;
case argminKLD:
partial = new PartialArgminKLD(scale);
break;
default:
throw new IllegalStateException("Unexpected event: " + event);
}
PartialResult existing = map.putIfAbsent(feature, partial);