import java.util.ArrayList;
import java.util.Arrays;
+import java.util.BitSet;
import java.util.List;
/**
return result;
}
+ @Override
+ public int markColumns(SequenceCollectionI sqcol, BitSet bs)
+ {
+ int count = 0;
+ for (SequenceI s : sqcol.getSequences())
+ {
+ BitSet mask = new BitSet();
+ int[] cols = getResults(s, sqcol.getStartRes(), sqcol.getEndRes());
+ if (cols != null)
+ {
+ for (int pair = 0; pair < cols.length; pair += 2)
+ {
+ mask.set(cols[pair], cols[pair + 1] + 1);
+ }
+ }
+ // find columns that were already selected
+ BitSet compl = (BitSet) mask.clone();
+ compl.and(bs);
+ count += compl.cardinality();
+ // and mark ranges not already marked
+ bs.or(mask);
+ }
+ return count;
+ }
+
/* (non-Javadoc)
* @see jalview.datamodel.SearchResultsI#getSize()
*/
import jalview.datamodel.SearchResults.Match;
+import java.util.BitSet;
import java.util.List;
public interface SearchResultsI
*/
public abstract List<Match> getResults();
+ /**
+ * Set bits in a bitfield for all columns in the given sequence collection
+ * that are highlighted
+ *
+ * @param sqcol
+ * the set of sequences to search for highlighted regions
+ * @param bs
+ * bitset to set
+ * @return number of bits set
+ */
+ public abstract int markColumns(SequenceCollectionI sqcol, BitSet bs);
}
\ No newline at end of file