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();
try {
int dotIndex = secondSymbol.indexOf('.');
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);
}
String thirdSymbol = ((SingleFeatureValue)thirdValue).getSymbol();
try {
int dotIndex = thirdSymbol.indexOf('.');
if (dotIndex == -1) {
secondInt = Integer.parseInt(thirdSymbol);
} else {
secondInt = Integer.parseInt(thirdSymbol.substring(0,dotIndex));
}
} catch (NumberFormatException e) {
throw new FeatureException("Could not cast the feature value '"+thirdSymbol+"' to integer value.", e);
}
Integer result = firstInt*secondInt*thirdInt;
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;
Double thirdReal = 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);
}
String thirdSymbol = ((SingleFeatureValue)thirdValue).getSymbol();
try {
thirdReal = Double.parseDouble(thirdSymbol);
} catch (NumberFormatException e) {
throw new FeatureException("Could not cast the feature value '"+thirdSymbol+"' to real value.", e);
}
Double result = firstReal*secondReal*thirdReal;
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. ");
}
}