use of org.knime.core.data.container.CloseableRowIterator in project GenericKnimeNodes by genericworkflownodes.
the class ColumnToListNodeModel method execute.
@Override
protected BufferedDataTable[] execute(BufferedDataTable[] inData, ExecutionContext exec) throws Exception {
BufferedDataContainer cont = exec.createDataContainer(outspec[0]);
List<DataCell> cells = new ArrayList<DataCell>();
CloseableRowIterator iter = inData[0].iterator();
while (iter.hasNext()) {
cells.add(iter.next().getCell(0));
}
ListCell lc = CollectionCellFactory.createListCell(cells);
DataRow row = new DefaultRow("Row 1", lc);
cont.addRowToTable(row);
cont.close();
return new BufferedDataTable[] { cont.getTable() };
}
Aggregations