}
public AttributeColumn minValueNumbersMerge(AttributeTable table, AttributeColumn[] columnsToMerge, String newColumnTitle) {
checkTableAndColumnsAreNumberOrNumberList(table, columnsToMerge);
AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class);
AttributeColumn newColumn;
newColumn = ac.addAttributeColumn(table, newColumnTitle, AttributeType.BIGDECIMAL);//Create as BIGDECIMAL column by default. Then it can be duplicated to other type.
if (newColumn == null) {
return null;
}
final int newColumnIndex = newColumn.getIndex();
BigDecimal min;
for (Attributes row : ac.getTableAttributeRows(table)) {
min = StatisticsUtils.minValue(ac.getRowNumbers(row, columnsToMerge));
row.setValue(newColumnIndex, min);
}
return newColumn;
}