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)
| 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 | /** |
no test coverage detected