firstInt = Integer.parseInt(firstSymbol);
} else {
firstInt = Integer.parseInt(firstSymbol.substring(0,dotIndex));
}
} catch (NumberFormatException e) {
throw new FeatureException("Could not cast the feature value '"+firstSymbol+"' to integer value.", e);
}
String secondSymbol = ((SingleFeatureValue)secondValue).getSymbol();
dotIndex = secondSymbol.indexOf('.');
try {
if (dotIndex == -1) {
secondInt = Integer.parseInt(secondSymbol);
} else {
secondInt = Integer.parseInt(secondSymbol.substring(0,dotIndex));
}
} catch (NumberFormatException e) {
throw new FeatureException("Could not cast the feature value '"+secondSymbol+"' to integer value.", e);
}
Integer result = firstInt*secondInt;
singleFeatureValue.setValue(result);
table.addSymbol(result.toString());
singleFeatureValue.setSymbol(result.toString());
} else if (column.getType() == ColumnDescription.REAL) {
Double firstReal = 0.0;
Double secondReal = 0.0;
try {
firstReal = Double.parseDouble(firstSymbol);
} catch (NumberFormatException e) {
throw new FeatureException("Could not cast the feature value '"+firstSymbol+"' to real value.", e);
}
String secondSymbol = ((SingleFeatureValue)secondValue).getSymbol();
try {
secondReal = Double.parseDouble(secondSymbol);
} catch (NumberFormatException e) {
throw new FeatureException("Could not cast the feature value '"+secondSymbol+"' to real value.", e);
}
Double result = firstReal*secondReal;
singleFeatureValue.setValue(result);
table.addSymbol(result.toString());
singleFeatureValue.setSymbol(result.toString());
}
singleFeatureValue.setNullValue(false);
singleFeatureValue.setIndexCode(1);
}
}
}
} else {
throw new FeatureException("It is not possible to merge Split-features. ");
}
}