(int row, TableRow source)
| 2376 | |
| 2377 | |
| 2378 | public TableRow setRow(int row, TableRow source) { |
| 2379 | // Make sure there are enough columns to add this data |
| 2380 | ensureBounds(row, source.getColumnCount() - 1); |
| 2381 | |
| 2382 | for (int col = 0; col < Math.min(source.getColumnCount(), columns.length); col++) { |
| 2383 | switch (columnTypes[col]) { |
| 2384 | case INT: |
| 2385 | setInt(row, col, source.getInt(col)); |
| 2386 | break; |
| 2387 | case LONG: |
| 2388 | setLong(row, col, source.getLong(col)); |
| 2389 | break; |
| 2390 | case FLOAT: |
| 2391 | setFloat(row, col, source.getFloat(col)); |
| 2392 | break; |
| 2393 | case DOUBLE: |
| 2394 | setDouble(row, col, source.getDouble(col)); |
| 2395 | break; |
| 2396 | case STRING: |
| 2397 | setString(row, col, source.getString(col)); |
| 2398 | break; |
| 2399 | case CATEGORY: |
| 2400 | int index = source.getInt(col); |
| 2401 | setInt(row, col, index); |
| 2402 | if (!columnCategories[col].hasCategory(index)) { |
| 2403 | columnCategories[col].setCategory(index, source.getString(col)); |
| 2404 | } |
| 2405 | break; |
| 2406 | |
| 2407 | default: |
| 2408 | throw new RuntimeException("no types"); |
| 2409 | } |
| 2410 | } |
| 2411 | return new RowPointer(this, row); |
| 2412 | } |
| 2413 | |
| 2414 | |
| 2415 | /** |
no test coverage detected