use of org.knime.core.data.container.BlobSupportDataRow in project knime-core by knime.
the class BlobSupportDataCellList method create.
/**
* Create new list based on selected cell from a {@link DataRow}. Using
* this method will check if the row is returned by a
* {@link BufferedDataTable} and will handle blobs appropriately.
*
* @param row The underlying row
* @param cols The indices of interest.
* @return A newly create list.
* @throws NullPointerException If either argument is null.
* @throws IndexOutOfBoundsException If the indices are invalid.
*/
public static BlobSupportDataCellList create(final DataRow row, final int[] cols) {
ArrayList<DataCell> coll = new ArrayList<DataCell>(cols.length);
for (int i = 0; i < cols.length; i++) {
DataCell c;
if (row instanceof BlobSupportDataRow) {
c = ((BlobSupportDataRow) row).getRawCell(cols[i]);
} else {
c = row.getCell(cols[i]);
}
coll.add(c);
}
return create(coll);
}
Aggregations