use of org.knime.base.node.preproc.columnTrans.RegExpCellFactory in project knime-core by knime.
the class Many2OneColPMMLNodeModel method getCellFactory.
private AbstractMany2OneCellFactory getCellFactory(final DataTableSpec spec) {
AbstractMany2OneCellFactory cellFactory;
IncludeMethod method = IncludeMethod.valueOf(m_includeMethod.getStringValue());
int[] includedColIndices = new int[m_includedColumns.getIncludeList().size()];
int index = 0;
for (String colName : m_includedColumns.getIncludeList()) {
includedColIndices[index++] = spec.findColumnIndex(colName);
}
String newColName = DataTableSpec.getUniqueColumnName(spec, m_appendedColumnName.getStringValue());
m_appendedColumnName.setStringValue(newColName);
if (method.equals(IncludeMethod.RegExpPattern)) {
cellFactory = new RegExpCellFactory(spec, newColName, includedColIndices, m_pattern.getStringValue());
} else if (method.equals(IncludeMethod.Minimum)) {
cellFactory = new MinMaxCellFactory(spec, newColName, includedColIndices, false);
} else if (method.equals(IncludeMethod.Binary)) {
cellFactory = new BinaryCellFactory(spec, newColName, includedColIndices);
} else {
cellFactory = new MinMaxCellFactory(spec, newColName, includedColIndices, true);
}
return cellFactory;
}
Aggregations