use of org.knime.core.node.config.ConfigWO in project knime-core by knime.
the class VirtualSubNodeInputNodeFactory method savePortTypeList.
/**
* @param portTypes
* @param config
*/
static void savePortTypeList(final PortType[] portTypes, final ConfigWO config) {
for (int i = 0; i < portTypes.length; i++) {
ConfigWO portSetting = config.addConfig("port_" + i);
portSetting.addInt("index", i);
ConfigWO portTypeConfig = portSetting.addConfig("type");
portTypes[i].save(portTypeConfig);
}
}
use of org.knime.core.node.config.ConfigWO in project knime-core by knime.
the class DefaultHiLiteMapper method save.
/**
* Saves the settings in this mapper to a config object. Note that it writes
* directly to the passed root node of the config tree. It's good practice
* to open an local config object on which this method is invoked.
* @param config The config to write to.
*/
public void save(final ConfigWO config) {
for (RowKey key : keySet()) {
Set<RowKey> mappedKeys = getKeys(key);
ConfigWO keySettings = config.addConfig(key.toString());
keySettings.addString(key.getString(), key.getString());
keySettings.addRowKeyArray(CFG_MAPPED_KEYS, mappedKeys.toArray(new RowKey[mappedKeys.size()]));
}
}
use of org.knime.core.node.config.ConfigWO in project knime-core by knime.
the class PMCCPortObjectAndSpec method save.
/**
* Saves this object to a config.
* @param m To save to.
*/
public void save(final ConfigWO m) {
ConfigWO sub = m.addConfig(CFG_INTERNAL);
sub.addStringArray(CFG_NAMES, m_colNames);
sub.addBoolean(CFG_CONTAINS_VALUES, m_correlations != null);
if (m_correlations != null) {
m_correlations.save(sub.addConfig(CFG_VALUES));
}
}
use of org.knime.core.node.config.ConfigWO in project knime-core by knime.
the class ColorModelNominal method save.
/**
* Saves the <code>DataCell</code> to <code>Color</code> mapping to the
* given <code>Config</code>. The color is split into red, green, blue, and
* alpha component which are stored as int array.
* @param config Save settings to.
* @see org.knime.core.data.property.ColorHandler.ColorModel
* #save(ConfigWO)
* @throws NullPointerException If the <i>config</i> is <code>null</code>.
*/
@Override
public void save(final ConfigWO config) {
ConfigWO keyConfig = config.addConfig(CFG_KEYS);
for (Map.Entry<DataCell, ColorAttr> e : m_map.entrySet()) {
DataCell key = e.getKey();
keyConfig.addDataCell(key.toString(), key);
Color color = e.getValue().getColor();
config.addInt(key.toString(), color.getRGB());
}
}
use of org.knime.core.node.config.ConfigWO in project knime-core by knime.
the class ShapeModelNominal method save.
/**
* Saves the <code>DataCell</code> to <code>Shape</code> mapping to the
* given <code>Config</code>.
* @param config Save settings to.
* @throws NullPointerException If the <i>config</i> is <code>null</code>.
*/
@Override
public void save(final ConfigWO config) {
ConfigWO keyConfig = config.addConfig(CFG_KEYS);
for (Map.Entry<DataCell, Shape> e : m_map.entrySet()) {
DataCell key = e.getKey();
keyConfig.addDataCell(key.toString(), key);
Shape shape = e.getValue();
config.addString(key.toString(), shape.toString());
}
}
Aggregations