public int getNumberOfMatches(AbstractTextSearchResult result) { int count = 0; Match[] matches = result.getMatches(fParent); for (int i = 0; i < matches.length; i++) { AbstractMatch curr = (AbstractMatch) matches[i]; if (curr.getLineElement() == this) { count++; } } return count; }
public AbstractMatch[] getMatches(AbstractTextSearchResult result) { List<AbstractMatch> res = new ArrayList<AbstractMatch>(); Match[] matches = result.getMatches(fParent); for (int i = 0; i < matches.length; i++) { AbstractMatch curr = (AbstractMatch) matches[i]; if (curr.getLineElement() == this) { res.add(curr); } } return res.toArray(new AbstractMatch[res.size()]); }