*/
public class SearchResults implements SearchResultsI
{
+ private int count;
private List<SearchResultMatchI> matches = new ArrayList<>();
if (!matches.contains(m))
{
matches.add(m);
+ count++;
}
return m;
}
@Override
+ public void addResult(SequenceI seq, int[] positions)
+ {
+ /*
+ * we only increment the match count by 1 - or not at all,
+ * if the matches are all duplicates of existing
+ */
+ int beforeCount = count;
+ for (int i = 0; i < positions.length - 1; i += 2)
+ {
+ addResult(seq, positions[i], positions[i + 1]);
+ }
+ if (count > beforeCount)
+ {
+ count = beforeCount + 1;
+ }
+ }
+
+ @Override
public boolean involvesSequence(SequenceI sequence)
{
SequenceI ds = sequence.getDatasetSequence();
}
@Override
- public int getSize()
+ public int getCount()
{
- return matches.size();
+ return count;
}
@Override