Search in sources :

Example 1 with MinMaxCellFactory

use of org.knime.base.node.preproc.columnTrans.MinMaxCellFactory 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;
}
Also used : RegExpCellFactory(org.knime.base.node.preproc.columnTrans.RegExpCellFactory) BinaryCellFactory(org.knime.base.node.preproc.columnTrans.BinaryCellFactory) AbstractMany2OneCellFactory(org.knime.base.node.preproc.columnTrans.AbstractMany2OneCellFactory) SettingsModelFilterString(org.knime.core.node.defaultnodesettings.SettingsModelFilterString) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString) MinMaxCellFactory(org.knime.base.node.preproc.columnTrans.MinMaxCellFactory)

Aggregations

AbstractMany2OneCellFactory (org.knime.base.node.preproc.columnTrans.AbstractMany2OneCellFactory)1 BinaryCellFactory (org.knime.base.node.preproc.columnTrans.BinaryCellFactory)1 MinMaxCellFactory (org.knime.base.node.preproc.columnTrans.MinMaxCellFactory)1 RegExpCellFactory (org.knime.base.node.preproc.columnTrans.RegExpCellFactory)1 SettingsModelFilterString (org.knime.core.node.defaultnodesettings.SettingsModelFilterString)1 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)1