public DataSetBuilder generate ( int count ) { ensureValid ( count , count > 0 ) ; DataSource source = data . getSource ( ) ; int columnCount = data . getSource ( ) . getColumnCount ( ) ; if ( fillerCount < fillers . length ) { for ( int c = 0 ; c < columnCount ; c ++ ) { if ( fillers [ c ] == null ) { throw new InvalidOperationException ( "No filler is set for column '" + source . getColumnName ( c ) ) ; } } throw new InternalErrorException ( "Filler count does not match fillers set." ) ; } for ( int r = 0 ; r < count ; r ++ ) { Object [ ] colData = new Object [ columnCount ] ; for ( int c = 0 ; c < columnCount ; c ++ ) { try { colData [ c ] = fillers [ c ] . next ( ) ; } catch ( Exception e ) { throw new ColumnFillerException ( "Error evaluating filler for '" + source . getColumnName ( c ) + "'" , e ) ; } } data . addRow ( new Row ( colData ) ) ; } return this ; }
Associate a number of rows to the data set according to the current column fillers configuration .