Search in sources :

Example 6 with SettingsModelIntegerBounded

use of org.knime.core.node.defaultnodesettings.SettingsModelIntegerBounded in project knime-core by knime.

the class NaiveBayesLearnerNodeModel method validateSettings.

/**
 * {@inheritDoc}
 */
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    final SettingsModelString colName = m_classifyColumnName.createCloneWithValidatedValue(settings);
    if (colName == null || colName.getStringValue().trim().length() < 1) {
        throw new InvalidSettingsException("No class column selected");
    }
    final SettingsModelIntegerBounded maxNoOfNomVals = m_maxNoOfNominalVals.createCloneWithValidatedValue(settings);
    if (maxNoOfNomVals.getIntValue() < 0) {
        throw new InvalidSettingsException("Maximum number of unique " + "nominal values should be a positive number");
    }
}
Also used : InvalidSettingsException(org.knime.core.node.InvalidSettingsException) SettingsModelIntegerBounded(org.knime.core.node.defaultnodesettings.SettingsModelIntegerBounded) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Aggregations

SettingsModelIntegerBounded (org.knime.core.node.defaultnodesettings.SettingsModelIntegerBounded)6 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)3 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)3 IOException (java.io.IOException)1 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)1 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)1