package jalview.datamodel; import jalview.datamodel.SearchResults.Match; import java.util.List; public interface SearchResultsI { /** * This method replaces the old search results which merely held an alignment * index of search matches. This broke when sequences were moved around the * alignment * * @param seq * Sequence * @param start * int * @param end * int */ public abstract void addResult(SequenceI seq, int start, int end); /** * Quickly check if the given sequence is referred to in the search results * * @param sequence * (specific alignment sequence or a dataset sequence) * @return true if the results involve sequence */ public abstract boolean involvesSequence(SequenceI sequence); /** * This Method returns the search matches which lie between the start and end * points of the sequence in question . It is optimised for returning objects * for drawing on SequenceCanvas * * @param sequence * sequence to highlight columns according to matches * @param start * - first column of visible region * @param end * - last column of visible region * @return int[] ranges within start/end index on sequence */ public abstract int[] getResults(SequenceI sequence, int start, int end); public abstract int getSize(); public abstract SequenceI getResultSequence(int index); /** * Returns the start position of the i'th match in the search results. * * @param i * @return */ public abstract int getResultStart(int i); /** * Returns the end position of the i'th match in the search results. * * @param i * @return */ public abstract int getResultEnd(int i); /** * Returns true if no search result matches are held. * * @return */ public abstract boolean isEmpty(); /** * Returns the list of matches. * * @return */ public abstract List getResults(); }