/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
package jalview.analysis;
import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResultMatchI;
import jalview.datamodel.SearchResults;
+import jalview.datamodel.SearchResultsI;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
/**
* Implements the search algorithms for the Find dialog box.
*/
- SearchResults searchResults;
+ SearchResultsI searchResults;
AlignmentI alignment;
selection = null;
}
}
+ SearchResultMatchI lastm = null;
while (!found && (seqIndex < end))
{
}
String noGaps = noGapsSB.toString();
-
for (int r = resIndex; r < noGaps.length(); r++)
{
- 1
+ Integer.parseInt(spaces
.elementAt(regex.matchedTo() - 1).toString()));
-
- searchResults.addResult(seq, sres, eres);
+ // only add result if not contained in previous result
+ if (lastm == null
+ || (lastm.getSequence() != seq || (!(lastm.getStart() <= sres && lastm
+ .getEnd() >= eres))))
+ {
+ lastm = searchResults.addResult(seq, sres, eres);
+ }
hasResults = true;
if (!findAll)
{
/**
* @return the searchResults
*/
- public SearchResults getSearchResults()
+ public SearchResultsI getSearchResults()
{
return searchResults;
}