(int newCount)
| 2316 | |
| 2317 | |
| 2318 | public void setRowCount(int newCount) { |
| 2319 | if (newCount != rowCount) { |
| 2320 | if (newCount > 1000000) { |
| 2321 | System.out.print("Note: setting maximum row count to " + PApplet.nfc(newCount)); |
| 2322 | } |
| 2323 | long t = System.currentTimeMillis(); |
| 2324 | for (int col = 0; col < columns.length; col++) { |
| 2325 | switch (columnTypes[col]) { |
| 2326 | case INT: columns[col] = PApplet.expand((int[]) columns[col], newCount); break; |
| 2327 | case LONG: columns[col] = PApplet.expand((long[]) columns[col], newCount); break; |
| 2328 | case FLOAT: columns[col] = PApplet.expand((float[]) columns[col], newCount); break; |
| 2329 | case DOUBLE: columns[col] = PApplet.expand((double[]) columns[col], newCount); break; |
| 2330 | case STRING: columns[col] = PApplet.expand((String[]) columns[col], newCount); break; |
| 2331 | case CATEGORY: columns[col] = PApplet.expand((int[]) columns[col], newCount); break; |
| 2332 | } |
| 2333 | if (newCount > 1000000) { |
| 2334 | try { |
| 2335 | Thread.sleep(10); // gc time! |
| 2336 | } catch (InterruptedException e) { |
| 2337 | e.printStackTrace(); |
| 2338 | } |
| 2339 | } |
| 2340 | } |
| 2341 | if (newCount > 1000000) { |
| 2342 | int ms = (int) (System.currentTimeMillis() - t); |
| 2343 | System.out.println(" (resize took " + PApplet.nfc(ms) + " ms)"); |
| 2344 | } |
| 2345 | } |
| 2346 | rowCount = newCount; |
| 2347 | } |
| 2348 | |
| 2349 | |
| 2350 | /** |
no test coverage detected