JAL-966 clarify javadoc for SearchResultsI.getResults
[jalview.git] / src / jalview / datamodel / SearchResultsI.java
1 package jalview.datamodel;
2
3 import jalview.datamodel.SearchResults.Match;
4
5 import java.util.List;
6
7 public interface SearchResultsI
8 {
9
10   /**
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
13    * alignment
14    * 
15    * @param seq
16    *          Sequence
17    * @param start
18    *          int
19    * @param end
20    *          int
21    */
22   public abstract void addResult(SequenceI seq, int start, int end);
23
24   /**
25    * Quickly check if the given sequence is referred to in the search results
26    * 
27    * @param sequence
28    *          (specific alignment sequence or a dataset sequence)
29    * @return true if the results involve sequence
30    */
31   public abstract boolean involvesSequence(SequenceI sequence);
32
33   /**
34    * This Method returns the search matches which lie between the start and end
35    * points of the sequence in question . It is optimised for returning objects
36    * for drawing on SequenceCanvas
37    * 
38    * @param sequence
39    *          sequence to highlight columns according to matches
40    * @param start
41    *          - first column of visible region
42    * @param end
43    *          - last column of visible region
44    * @return int[] ranges within start/end index on sequence
45    */
46   public abstract int[] getResults(SequenceI sequence, int start, int end);
47
48   public abstract int getSize();
49
50   public abstract SequenceI getResultSequence(int index);
51
52   /**
53    * Returns the start position of the i'th match in the search results.
54    * 
55    * @param i
56    * @return
57    */
58   public abstract int getResultStart(int i);
59
60   /**
61    * Returns the end position of the i'th match in the search results.
62    * 
63    * @param i
64    * @return
65    */
66   public abstract int getResultEnd(int i);
67
68   /**
69    * Returns true if no search result matches are held.
70    * 
71    * @return
72    */
73   public abstract boolean isEmpty();
74
75   /**
76    * Returns the list of matches.
77    * 
78    * @return
79    */
80   public abstract List<Match> getResults();
81
82 }