1 package jalview.datamodel;
3 import java.util.BitSet;
7 * An interface describing the result of a search or other operation which
8 * highlights matched regions of an alignment
10 public interface SearchResultsI
14 * Adds one region to the results
24 SearchResultMatchI addResult(SequenceI seq, int start, int end);
27 * Answers true if the search results include the given sequence (or its
28 * dataset sequence), else false
33 boolean involvesSequence(SequenceI sequence);
36 * Returns an array of [from, to, from, to..] matched columns (base 0) between
37 * the given start and end columns of the given sequence. Returns null if no
38 * matches overlap the specified region.
40 * Implementations should provide an optimised method to return locations to
41 * highlight on a visible portion of an alignment.
45 * first column of range (base 0, inclusive)
47 * last column of range base 0, inclusive)
50 int[] getResults(SequenceI sequence, int start, int end);
53 * Returns the number of matches found
60 * Returns true if no search result matches are held.
67 * Returns the list of matches.
71 List<SearchResultMatchI> getResults();
74 * Set bits in a bitfield for all columns in the given sequence collection
75 * that are highlighted
78 * the set of sequences to search for highlighted regions
81 * @return number of bits set
83 int markColumns(SequenceCollectionI sqcol, BitSet bs);