(int row, TableRow source)
| 2333 | |
| 2334 | |
| 2335 | public TableRow setRow(int row, TableRow source) { |
| 2336 | // Make sure there are enough columns to add this data |
| 2337 | ensureBounds(row, source.getColumnCount() - 1); |
| 2338 | |
| 2339 | for (int col = 0; col < Math.min(source.getColumnCount(), columns.length); col++) { |
| 2340 | switch (columnTypes[col]) { |
| 2341 | case INT: |
| 2342 | setInt(row, col, source.getInt(col)); |
| 2343 | break; |
| 2344 | case LONG: |
| 2345 | setLong(row, col, source.getLong(col)); |
| 2346 | break; |
| 2347 | case FLOAT: |
| 2348 | setFloat(row, col, source.getFloat(col)); |
| 2349 | break; |
| 2350 | case DOUBLE: |
| 2351 | setDouble(row, col, source.getDouble(col)); |
| 2352 | break; |
| 2353 | case STRING: |
| 2354 | setString(row, col, source.getString(col)); |
| 2355 | break; |
| 2356 | case CATEGORY: |
| 2357 | int index = source.getInt(col); |
| 2358 | setInt(row, col, index); |
| 2359 | if (!columnCategories[col].hasCategory(index)) { |
| 2360 | columnCategories[col].setCategory(index, source.getString(col)); |
| 2361 | } |
| 2362 | break; |
| 2363 | |
| 2364 | default: |
| 2365 | throw new RuntimeException("no types"); |
| 2366 | } |
| 2367 | } |
| 2368 | return new RowPointer(this, row); |
| 2369 | } |
| 2370 | |
| 2371 | |
| 2372 | /** |
no test coverage detected