MCPcopy Index your code
hub / github.com/benfry/processing4 / setRowCount

Method setRowCount

core/src/processing/data/Table.java:2318–2347  ·  view source on GitHub ↗
(int newCount)

Source from the content-addressed store, hash-verified

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 /**

Callers 10

TableMethod · 0.95
parseBasicMethod · 0.95
loadBinaryMethod · 0.95
clearRowsMethod · 0.95
addRowMethod · 0.95
addRowsMethod · 0.95
trimMethod · 0.95
ensureRowMethod · 0.95
createSubsetMethod · 0.95
clearRowsMethod · 0.80

Calls 5

nfcMethod · 0.95
expandMethod · 0.95
printMethod · 0.65
printStackTraceMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected