(Object[] search)
| 1606 | /// |
| 1607 | /// Array of Strings whose toString() value matches this regular expression. |
| 1608 | public String[] grep(Object[] search) { |
| 1609 | // Create new vector to hold return items |
| 1610 | ArrayList v = new ArrayList(); |
| 1611 | |
| 1612 | // Traverse array of objects |
| 1613 | for (Object item : search) { |
| 1614 | // Get next object as a string |
| 1615 | String s = item.toString(); |
| 1616 | |
| 1617 | // If it matches this regexp, add it to the list |
| 1618 | if (match(s)) { |
| 1619 | v.add(s); |
| 1620 | } |
| 1621 | } |
| 1622 | |
| 1623 | // Return vector as an array of strings |
| 1624 | String[] ret = new String[v.size()]; |
| 1625 | v.toArray(ret); |
| 1626 | return ret; |
| 1627 | } |
| 1628 | |
| 1629 | /// #### Returns |
| 1630 | /// |
no test coverage detected