(int newCount)
| 2280 | |
| 2281 | |
| 2282 | public void setRowCount(int newCount) { |
| 2283 | if (newCount != rowCount) { |
| 2284 | if (newCount > 1000000) { |
| 2285 | System.out.print("Note: setting maximum row count to " + PApplet.nfc(newCount)); |
| 2286 | } |
| 2287 | long t = System.currentTimeMillis(); |
| 2288 | for (int col = 0; col < columns.length; col++) { |
| 2289 | switch (columnTypes[col]) { |
| 2290 | case INT: columns[col] = PApplet.expand((int[]) columns[col], newCount); break; |
| 2291 | case LONG: columns[col] = PApplet.expand((long[]) columns[col], newCount); break; |
| 2292 | case FLOAT: columns[col] = PApplet.expand((float[]) columns[col], newCount); break; |
| 2293 | case DOUBLE: columns[col] = PApplet.expand((double[]) columns[col], newCount); break; |
| 2294 | case STRING: columns[col] = PApplet.expand((String[]) columns[col], newCount); break; |
| 2295 | case CATEGORY: columns[col] = PApplet.expand((int[]) columns[col], newCount); break; |
| 2296 | } |
| 2297 | if (newCount > 1000000) { |
| 2298 | try { |
| 2299 | Thread.sleep(10); // gc time! |
| 2300 | } catch (InterruptedException e) { |
| 2301 | e.printStackTrace(); |
| 2302 | } |
| 2303 | } |
| 2304 | } |
| 2305 | if (newCount > 1000000) { |
| 2306 | int ms = (int) (System.currentTimeMillis() - t); |
| 2307 | System.out.println(" (resize took " + PApplet.nfc(ms) + " ms)"); |
| 2308 | } |
| 2309 | } |
| 2310 | rowCount = newCount; |
| 2311 | } |
| 2312 | |
| 2313 | |
| 2314 | /** |
no test coverage detected