MCPcopy Index your code
hub / github.com/processing/processing / setRowCol

Method setRowCol

core/src/processing/data/Table.java:2561–2639  ·  view source on GitHub ↗
(int row, int col, Object piece)

Source from the content-addressed store, hash-verified

2559
2560
2561 protected void setRowCol(int row, int col, Object piece) {
2562 switch (columnTypes[col]) {
2563 case STRING:
2564 String[] stringData = (String[]) columns[col];
2565 if (piece == null) {
2566 stringData[row] = null;
2567// } else if (piece instanceof String) {
2568// stringData[row] = (String) piece;
2569 } else {
2570 // Calls toString() on the object, which is 'return this' for String
2571 stringData[row] = String.valueOf(piece);
2572 }
2573 break;
2574 case INT:
2575 int[] intData = (int[]) columns[col];
2576 //intData[row] = PApplet.parseInt(piece, missingInt);
2577 if (piece == null) {
2578 intData[row] = missingInt;
2579 } else if (piece instanceof Integer) {
2580 intData[row] = (Integer) piece;
2581 } else {
2582 intData[row] = PApplet.parseInt(String.valueOf(piece), missingInt);
2583 }
2584 break;
2585 case LONG:
2586 long[] longData = (long[]) columns[col];
2587 if (piece == null) {
2588 longData[row] = missingLong;
2589 } else if (piece instanceof Long) {
2590 longData[row] = (Long) piece;
2591 } else {
2592 try {
2593 longData[row] = Long.parseLong(String.valueOf(piece));
2594 } catch (NumberFormatException nfe) {
2595 longData[row] = missingLong;
2596 }
2597 }
2598 break;
2599 case FLOAT:
2600 float[] floatData = (float[]) columns[col];
2601 if (piece == null) {
2602 floatData[row] = missingFloat;
2603 } else if (piece instanceof Float) {
2604 floatData[row] = (Float) piece;
2605 } else {
2606 floatData[row] = PApplet.parseFloat(String.valueOf(piece), missingFloat);
2607 }
2608 break;
2609 case DOUBLE:
2610 double[] doubleData = (double[]) columns[col];
2611 if (piece == null) {
2612 doubleData[row] = missingDouble;
2613 } else if (piece instanceof Double) {
2614 doubleData[row] = (Double) piece;
2615 } else {
2616 try {
2617 doubleData[row] = Double.parseDouble(String.valueOf(piece));
2618 } catch (NumberFormatException nfe) {

Callers 1

setRowMethod · 0.95

Calls 4

parseIntMethod · 0.95
parseFloatMethod · 0.95
equalsMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected