use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class DefaultTableStoreWriter method writeMetaInfoAfterWrite.
/**
* {@inheritDoc}
*/
@Override
public void writeMetaInfoAfterWrite(final NodeSettingsWO settings) {
settings.addString(DefaultTableStoreFormat.CFG_COMPRESSION, m_compressionFormat.name());
// unreported bug fix: NPE when the table only contains missing values.
if (m_typeShortCuts == null) {
m_typeShortCuts = new HashMap<CellClassInfo, Byte>();
}
CellClassInfo[] shortCutsLookup = new CellClassInfo[m_typeShortCuts.size()];
for (Map.Entry<CellClassInfo, Byte> e : m_typeShortCuts.entrySet()) {
byte shortCut = e.getValue();
CellClassInfo type = e.getKey();
shortCutsLookup[shortCut - BYTE_TYPE_START] = type;
}
m_shortCutsLookup = shortCutsLookup;
NodeSettingsWO typeSubSettings = settings.addNodeSettings(DefaultTableStoreFormat.CFG_CELL_CLASSES);
for (int i = 0; i < shortCutsLookup.length; i++) {
CellClassInfo info = shortCutsLookup[i];
NodeSettingsWO single = typeSubSettings.addNodeSettings("element_" + i);
single.addString(DefaultTableStoreFormat.CFG_CELL_SINGLE_CLASS, info.getCellClass().getName());
DataType elementType = info.getCollectionElementType();
if (elementType != null) {
NodeSettingsWO subTypeConfig = single.addNodeSettings(DefaultTableStoreFormat.CFG_CELL_SINGLE_ELEMENT_TYPE);
elementType.save(subTypeConfig);
}
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class JoinedTable method saveToFile.
/**
* {@inheritDoc}
*/
@Override
public void saveToFile(final File f, final NodeSettingsWO settings, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
NodeSettingsWO internals = settings.addNodeSettings(CFG_INTERNAL_META);
internals.addInt(CFG_LEFT_TABLE_ID, m_leftTable.getBufferedTableId());
internals.addInt(CFG_RIGHT_TABLE_ID, m_rightTable.getBufferedTableId());
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class RearrangeColumnsTable method saveToFile.
/**
* {@inheritDoc}
*/
@Override
public void saveToFile(final File f, final NodeSettingsWO s, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
NodeSettingsWO subSettings = s.addNodeSettings(CFG_INTERNAL_META);
subSettings.addInt(CFG_REFERENCE_ID, m_reference.getBufferedTableId());
subSettings.addIntArray(CFG_MAP, m_map);
subSettings.addBooleanArray(CFG_FLAGS, m_isFromRefTable);
if (m_appendTable != null) {
// subSettings argument is ignored in ContainerTable
m_appendTable.saveToFile(f, subSettings, exec);
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class NodeExecutionJobManagerPool method saveJobManager.
/**
* Saves the argument job manager to a settings object.
*
* @param jobManager The job manager to save.
* @param settings To save to.
*/
public static void saveJobManager(final NodeExecutionJobManager jobManager, final NodeSettingsWO settings) {
settings.addString(CFG_JOB_MANAGER_FACTORY_ID, jobManager.getID());
NodeSettingsWO sub = settings.addNodeSettings(CFG_JOB_MANAGER_SETTINGS);
jobManager.save(sub);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class CreateTempDirectoryConfiguration method save.
void save(final NodeSettingsWO settings) {
settings.addString("baseName", m_baseName);
settings.addString("variableName", m_variableName);
settings.addBoolean("deleteOnReset", m_deleteOnReset);
NodeSettingsWO pairs = settings.addNodeSettings("variable_name_pairs");
if (m_pairs != null) {
for (VarNameFileNamePair v : m_pairs) {
NodeSettingsWO p = pairs.addNodeSettings(v.getVariableName());
p.addString("variableName", v.getVariableName());
p.addString("fileName", v.getFileName());
}
}
}
Aggregations