class RowMapperResultSetExtractor implements ResultSetExtractor {

    protected final RowMapper rowMapper;

    protected final int rowsExpected;


    /**
     * Create a new RowMapperResultSetExtractor.
     *
     * @param rowMapper the RowMapper which creates an object for each row
     */
    public RowMapperResultSetExtractor(RowMapper rowMapper) {
        this(rowMapper, 0);
    }

    /**
     * Create a new RowMapperResultSetExtractor.
     *
     * @param rowMapper    the RowMapper which creates an object for each row
     * @param rowsExpected the number of expected rows
     *                     (just used for optimized collection handling)
     */
    public RowMapperResultSetExtractor(RowMapper rowMapper, int rowsExpected) {
        this.rowMapper = rowMapper;
        this.rowsExpected = rowsExpected;
    }


    @Override
    public Object extractData(ResultSet rs) throws SQLException {<FILL_FUNCTION_BODY>}

}

        List results = ((this.rowsExpected > 0) ? new ArrayList(this.rowsExpected) : new ArrayList());
        int rowNum = 0;
        while (rs.next()) {
            results.add(this.rowMapper.mapRow(rs, rowNum++));
        }
        return results;
    
<no_super_class>