Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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()]);
 }