use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class PolyRegLearnerSettings method createFakeSettings.
/**
* Creates a fake configuration to help migrating the old configuration.
*
* @param configName Name of the {@link NodeSettings} to create.
* @param included The included column names.
* @param excluded The excluded column names.
* @param includeAll Should we include all columns that are not in the exclude list ({@code true}), or use the include list ({@code false})?
* @return The fake {@link NodeSettings}.
*/
static NodeSettings createFakeSettings(final String configName, final String[] included, final String[] excluded, final boolean includeAll) {
NodeSettings fakeSettings = new NodeSettings("FakeRoot");
NodeSettings filterSettings = (NodeSettings) fakeSettings.addNodeSettings(configName);
filterSettings.addString("filter-type", "STANDARD");
filterSettings.addStringArray("included_names", included);
filterSettings.addStringArray("excluded_names", excluded);
filterSettings.addString("enforce_option", (includeAll ? EnforceOption.EnforceExclusion : EnforceOption.EnforceInclusion).name());
NodeSettings datatypeSettings = (NodeSettings) filterSettings.addNodeSettings("datatype");
NodeSettingsWO typelist = datatypeSettings.addNodeSettings("typelist");
typelist.addBoolean(DoubleValue.class.getName(), true);
return fakeSettings;
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class SettingsModelPCADimensions method saveSettingsForModel.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsForModel(final NodeSettingsWO settings) {
final NodeSettingsWO set = settings.addNodeSettings(m_configName);
set.addBoolean("choice", m_dimensionsSelected);
set.addDouble("doubleVal", m_minQuality);
set.addInt("intVal", m_dimensions);
set.addDoubleArray("eigenvalues", m_eigenvalues);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class DataValidatorConfiguration method saveSettings.
/**
* Called from dialog's and model's save method.
*
* @param settings Arg settings.
*/
void saveSettings(final NodeSettingsWO settings) {
NodeSettingsWO individuals = settings.addNodeSettings(CFG_INDIVDUALS);
int counter = 0;
for (DataValidatorColConfiguration config : m_individualConfigurations) {
NodeSettingsWO addNodeSettings = individuals.addNodeSettings("" + counter++);
config.save(addNodeSettings);
}
addEnum(settings, CFG_REMOVE_UNKOWN_COLUMNS, m_removeUnkownColumns);
addEnum(settings, CFG_REJECTING_BEHAVIOR, m_failingBehavior);
if (m_referenceSpecNeedet) {
m_referenceTableSpec.save(settings.addNodeSettings(CFG_SPEC));
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class EditNominalDomainConfiguration method saveSettings.
/**
* Called from dialog's and model's save method.
*
* @param settings Arg settings.
*/
void saveSettings(final NodeSettingsWO settings) {
settings.addBoolean(IGNORE_NOT_MATHING_TYPES, m_ignoreWrongTypes);
settings.addBoolean(IGNORE_NOT_PRESENT_COLS, m_ignoreNotExistingColumns);
NodeSettingsWO cols = settings.addNodeSettings(COLUMNS);
for (Map.Entry<String, List<DataCell>> entry : m_colMapping.entrySet()) {
NodeSettingsWO col = cols.addNodeSettings(entry.getKey());
col.addDataCellArray(COLUMN_ORDERING, entry.getValue().toArray(new DataCell[entry.getValue().size()]));
Set<DataCell> createdValues = m_createdDomainValues.get(entry.getKey());
if (createdValues != null && !createdValues.isEmpty()) {
//
col.addDataCellArray(//
COLUMN_CREATED_VALS, createdValues.toArray(new DataCell[createdValues.size()]));
}
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class Joiner2NodeModel method saveInternals.
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
NodeSettings internalSettings = new NodeSettings("joiner");
NodeSettingsWO leftMapSet = internalSettings.addNodeSettings("leftHiliteMapping");
((DefaultHiLiteMapper) m_leftTranslator.getMapper()).save(leftMapSet);
NodeSettingsWO rightMapSet = internalSettings.addNodeSettings("rightHiliteMapping");
((DefaultHiLiteMapper) m_rightTranslator.getMapper()).save(rightMapSet);
File f = new File(nodeInternDir, "joinerInternalSettings");
FileOutputStream out = new FileOutputStream(f);
internalSettings.saveToXML(out);
}
Aggregations