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

Method findRowIndex

core/src/processing/data/Table.java:3592–3620  ·  view source on GitHub ↗

Return the row that contains the first String that matches. @param value the String to match @param column ID number of the column to search

(String value, int column)

Source from the content-addressed store, hash-verified

3590 * @param column ID number of the column to search
3591 */
3592 public int findRowIndex(String value, int column) {
3593 checkColumn(column);
3594 if (columnTypes[column] == STRING) {
3595 String[] stringData = (String[]) columns[column];
3596 if (value == null) {
3597 for (int row = 0; row < rowCount; row++) {
3598 if (stringData[row] == null) return row;
3599 }
3600 } else {
3601 for (int row = 0; row < rowCount; row++) {
3602 if (stringData[row] != null && stringData[row].equals(value)) {
3603 return row;
3604 }
3605 }
3606 }
3607 } else { // less efficient, includes conversion as necessary
3608 for (int row = 0; row < rowCount; row++) {
3609 String str = getString(row, column);
3610 if (str == null) {
3611 if (value == null) {
3612 return row;
3613 }
3614 } else if (str.equals(value)) {
3615 return row;
3616 }
3617 }
3618 }
3619 return -1;
3620 }
3621
3622
3623 /**

Callers 1

findRowMethod · 0.95

Calls 4

checkColumnMethod · 0.95
getStringMethod · 0.95
getColumnIndexMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected