1 package jalview.datamodel;
4 import java.util.BitSet;
7 public interface SearchResultsI
11 * This method replaces the old search results which merely held an alignment
12 * index of search matches. This broke when sequences were moved around the
21 * @return SearchResultMatchI instance created for this instance
23 public abstract SearchResultMatchI addResult(SequenceI seq, int start,
27 * Quickly check if the given sequence is referred to in the search results
30 * (specific alignment sequence or a dataset sequence)
31 * @return true if the results involve sequence
33 public abstract boolean involvesSequence(SequenceI sequence);
36 * This Method returns the search matches which lie between the start and end
37 * points of the sequence in question . It is optimised for returning objects
38 * for drawing on SequenceCanvas
41 * sequence to highlight columns according to matches
43 * - first column of visible region
45 * - last column of visible region
46 * @return int[] ranges within start/end index on sequence
48 public abstract int[] getResults(SequenceI sequence, int start, int end);
50 public abstract int getSize();
52 public abstract SequenceI getResultSequence(int index);
55 * Returns the start position of the i'th match in the search results.
60 public abstract int getResultStart(int i);
63 * Returns the end position of the i'th match in the search results.
68 public abstract int getResultEnd(int i);
71 * Returns true if no search result matches are held.
75 public abstract boolean isEmpty();
78 * Returns the list of matches.
82 public abstract List<SearchResultMatchI> getResults();
85 * Set bits in a bitfield for all columns in the given sequence collection
86 * that are highlighted
89 * the set of sequences to search for highlighted regions
92 * @return number of bits set
94 public abstract int markColumns(SequenceCollectionI sqcol, BitSet bs);