use of org.knime.core.node.defaultnodesettings.SettingsModelDouble in project knime-core by knime.
the class MissingValueColumnFilterNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
DataColumnSpecFilterConfiguration conf = createDCSFilterConfiguration();
conf.loadConfigurationInModel(settings);
SettingsModelDouble percentage = createSettingsModelNumber();
percentage.validateSettings(settings);
}
use of org.knime.core.node.defaultnodesettings.SettingsModelDouble in project knime-core by knime.
the class TableToVariableNodeDialog method getReplaceDouble.
/**
* @param policyModel The policy model.
* @return the SM for the new Double Value.
*/
static final SettingsModelDouble getReplaceDouble(final SettingsModelString policyModel) {
final SettingsModelDouble model = new SettingsModelDouble("CFG_Double", 0);
ChangeListener listener = new PolicyChangeListener(policyModel, model);
policyModel.addChangeListener(listener);
listener.stateChanged(null);
return model;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelDouble in project knime-core by knime.
the class SVMLearnerNodeModel method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) {
settings.addString(CFG_KERNELTYPE, m_kernelType.toString());
m_paramC.saveSettingsTo(settings);
m_classcol.saveSettingsTo(settings);
for (Map.Entry<KernelType, Vector<SettingsModelDouble>> entry : m_kernelParameters.entrySet()) {
Vector<SettingsModelDouble> kernelsettings = entry.getValue();
for (SettingsModelDouble smd : kernelsettings) {
smd.saveSettingsTo(settings);
}
}
}
use of org.knime.core.node.defaultnodesettings.SettingsModelDouble in project knime-core by knime.
the class SVMLearnerNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
if (settings.containsKey(CFG_KERNELTYPE)) {
String tmpKernel = settings.getString(CFG_KERNELTYPE);
boolean found = false;
for (String kernel : KernelFactory.getKernelNames()) {
if (tmpKernel.equals(kernel)) {
found = true;
}
}
if (!found) {
throw new InvalidSettingsException("Unknown kernel type: " + tmpKernel);
}
}
for (Map.Entry<KernelType, Vector<SettingsModelDouble>> entry : m_kernelParameters.entrySet()) {
Vector<SettingsModelDouble> kernelsettings = entry.getValue();
for (SettingsModelDouble smd : kernelsettings) {
try {
smd.validateSettings(settings);
} catch (InvalidSettingsException ise) {
// it's not bad if a parameter is missing. This may be
// an old version, but inform the user.
LOGGER.warn("Did not find " + smd.toString() + " in the" + " NodeSettings. Using default value instead.");
}
}
}
m_paramC.validateSettings(settings);
m_classcol.validateSettings(settings);
}
Aggregations