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

Method matchRowIndex

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

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

(String regexp, int column)

Source from the content-addressed store, hash-verified

3765 * @param column ID number of the column to search
3766 */
3767 public int matchRowIndex(String regexp, int column) {
3768 checkColumn(column);
3769 if (columnTypes[column] == STRING) {
3770 String[] stringData = (String[]) columns[column];
3771 for (int row = 0; row < rowCount; row++) {
3772 if (stringData[row] != null &&
3773 PApplet.match(stringData[row], regexp) != null) {
3774 return row;
3775 }
3776 }
3777 } else { // less efficient, includes conversion as necessary
3778 for (int row = 0; row < rowCount; row++) {
3779 String str = getString(row, column);
3780 if (str != null &&
3781 PApplet.match(str, regexp) != null) {
3782 return row;
3783 }
3784 }
3785 }
3786 return -1;
3787 }
3788
3789
3790 /**

Callers 1

matchRowMethod · 0.95

Calls 4

checkColumnMethod · 0.95
matchMethod · 0.95
getStringMethod · 0.95
getColumnIndexMethod · 0.95

Tested by

no test coverage detected