List<Value> alternativeValues = valueMap.get(alternative).getList();
List<Double> alternativeTransformedValues = new ArrayList<Double>();
// collect alternativeTransformedValues
for (Value alternativeValue : alternativeValues) {
TargetValue targetValue;
// do ordinal transformation
if (transformer instanceof OrdinalTransformer) {
OrdinalTransformer ordTrans = (OrdinalTransformer) transformer;
if (alternativeValue instanceof IOrdinalValue) {
try {
targetValue = ordTrans.transform((IOrdinalValue) alternativeValue);
} catch (NullPointerException e) {
log.warn("Measurement of leaf doesn't match with OrdinalTransformer! Ignoring it!");
log.warn("MeasuredValue-id: " + alternativeValue.getId() + "; Transformer-id: "
+ ordTrans.getId());
// FIXME: this is a workaround for a strange bug
// described in changeset 4342
skipAlternativeBecauseOfErrors = true;
continue;
}
alternativeTransformedValues.add(targetValue.getValue());
} else {
log.warn("getActualOutputRange(): INumericValue value passed to OrdinalTransformer - ignore value");
}
}
// do numeric transformation
if (transformer instanceof NumericTransformer) {
NumericTransformer numericTrans = (NumericTransformer) transformer;
if (alternativeValue instanceof INumericValue) {
targetValue = numericTrans.transform((INumericValue) alternativeValue);
alternativeTransformedValues.add(targetValue.getValue());
} else {
log.warn("getActualOutputRange(): IOrdinalValue value passed to NumericTransformer - ignore value");
}
}
}