for ( List<DTCellValue52> sourceRowData : copiedRows ) {
List<DTCellValue52> rowData = cellValueFactory.makeRowData();
//Clone the row, other than RowNumber column
for ( int iCol = 1; iCol < sourceRowData.size(); iCol++ ) {
DTCellValue52 sourceCell = sourceRowData.get( iCol );
DTCellValue52 targetCell = rowData.get( iCol );
switch ( sourceCell.getDataType() ) {
case BOOLEAN :
targetCell.setBooleanValue( sourceCell.getBooleanValue() );
break;
case DATE :
targetCell.setDateValue( sourceCell.getDateValue() );
break;
case NUMERIC :
targetCell.setNumericValue( sourceCell.getNumericValue() );
break;
case NUMERIC_BIGDECIMAL :
targetCell.setNumericValue( (BigDecimal) sourceCell.getNumericValue() );
break;
case NUMERIC_BIGINTEGER :
targetCell.setNumericValue( (BigInteger) sourceCell.getNumericValue() );
break;
case NUMERIC_BYTE :
targetCell.setNumericValue( (Byte) sourceCell.getNumericValue() );
break;
case NUMERIC_DOUBLE :
targetCell.setNumericValue( (Double) sourceCell.getNumericValue() );
break;
case NUMERIC_FLOAT :
targetCell.setNumericValue( (Float) sourceCell.getNumericValue() );
break;
case NUMERIC_INTEGER :
targetCell.setNumericValue( (Integer) sourceCell.getNumericValue() );
break;
case NUMERIC_LONG :
targetCell.setNumericValue( (Long) sourceCell.getNumericValue() );
break;
case NUMERIC_SHORT :
targetCell.setNumericValue( (Short) sourceCell.getNumericValue() );
break;
default :
targetCell.setStringValue( sourceCell.getStringValue() );
}
}
model.getData().add( iRow,
rowData );