Merge branch 'documentation/JAL-3407_2.11.1_release' into releases/Release_2_11_1_Branch
[jalview.git] / src / jalview / api / FinderI.java
1 package jalview.api;
2
3 import jalview.datamodel.SearchResultsI;
4 import jalview.datamodel.SequenceI;
5
6 import java.util.List;
7
8 /**
9  * An interface for searching for a pattern in an aligment
10  */
11 public interface FinderI
12 {
13
14   /**
15    * Performs a find for the given search string (interpreted as a regular
16    * expression). Search may optionally be case-sensitive, and may optionally
17    * including match in sequence description (sequence id is always searched).
18    * If the viewport has an active selection, then the find is restricted to the
19    * selection region. Sequences matched by id or description can be retrieved
20    * by getIdMatches(), and matched residue patterns by getSearchResults().
21    * 
22    * @param theSearchString
23    * @param caseSensitive
24    * @param searchDescription
25    * @return
26    */
27   void findAll(String theSearchString, boolean caseSensitive,
28           boolean searchDescription);
29
30   /**
31    * Finds the next match for the given search string (interpreted as a regular
32    * expression), starting from the position after the last match found. Search
33    * may optionally be case-sensitive, and may optionally including match in
34    * sequence description (sequence id is always searched). If the viewport has
35    * an active selection, then the find is restricted to the selection region.
36    * Sequences matched by id or description can be retrieved by getIdMatches(),
37    * and matched residue patterns by getSearchResults().
38    * 
39    * @param theSearchString
40    * @param caseSensitive
41    * @param searchDescription
42    * @return
43    */
44   void findNext(String theSearchString, boolean caseSensitive,
45           boolean searchDescription);
46
47   /**
48    * Returns the (possibly empty) list of sequences matched on sequence name or
49    * description
50    * 
51    * @return
52    */
53   List<SequenceI> getIdMatches();
54
55   /**
56    * Answers the search results (possibly empty) from the last search
57    * 
58    * @return
59    */
60   SearchResultsI getSearchResults();
61
62 }