use of org.knime.core.node.ModelContentRO in project knime-core by knime.
the class URIPortObject method load.
/**
* {@inheritDoc}
*/
@Override
protected void load(final ModelContentRO model, final PortObjectSpec spec, final ExecutionMonitor exec) throws InvalidSettingsException, CanceledExecutionException {
List<URIContent> list = new ArrayList<URIContent>();
for (String key : model.keySet()) {
if (key.startsWith("child-")) {
ModelContentRO child = model.getModelContent(key);
list.add(URIContent.load(child));
}
}
m_uriContents = Collections.unmodifiableList(list);
m_uriPortObjectSpec = (URIPortObjectSpec) spec;
}
use of org.knime.core.node.ModelContentRO in project knime-core by knime.
the class NumericOutliersModel method loadModel.
/**
* Loads the information provided by the model content into the model.
*
* @param model the model content to be loaded
* @throws InvalidSettingsException if the outliers defined by the model content differs from the outliers defining
* the intervals
*/
@SuppressWarnings("unchecked")
private void loadModel(final ModelContentRO model) throws InvalidSettingsException {
final Enumeration<ModelContentRO> rowContents = model.children();
while (rowContents.hasMoreElements()) {
// acess the current group
final ModelContentRO rowContent = rowContents.nextElement();
// load the group key
final GroupKey key = new GroupKey(rowContent.getModelContent("key").getDataCellArray(CFG_GROUP_KEY));
// load all intervals for the current group key
ModelContentRO intervalCols = rowContent.getModelContent(CFG_INTERVAL_COLUMNS);
final Enumeration<ModelContentRO> intervalContents = intervalCols.children();
while (intervalContents.hasMoreElements()) {
final ModelContentRO intervalContent = intervalContents.nextElement();
addEntry(key, intervalContent.getString("outlier"), intervalContent.getDoubleArray(CFG_INTERVAL));
}
}
}
Aggregations