2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.datamodel.SearchResultsI;
24 import jalview.datamodel.SequenceI;
26 import java.util.List;
29 * An interface for searching for a pattern in an aligment
31 public interface FinderI
35 * Performs a find for the given search string (interpreted as a regular
36 * expression). Search may optionally be case-sensitive, and may optionally
37 * including match in sequence description (sequence id is always searched).
38 * If the viewport has an active selection, then the find is restricted to the
39 * selection region. Sequences matched by id or description can be retrieved
40 * by getIdMatches(), and matched residue patterns by getSearchResults().
42 * @param theSearchString
43 * @param caseSensitive
44 * @param searchDescription
47 void findAll(String theSearchString, boolean caseSensitive,
48 boolean searchDescription);
51 * Finds the next match for the given search string (interpreted as a regular
52 * expression), starting from the position after the last match found. Search
53 * may optionally be case-sensitive, and may optionally including match in
54 * sequence description (sequence id is always searched). If the viewport has
55 * an active selection, then the find is restricted to the selection region.
56 * Sequences matched by id or description can be retrieved by getIdMatches(),
57 * and matched residue patterns by getSearchResults().
59 * @param theSearchString
60 * @param caseSensitive
61 * @param searchDescription
64 void findNext(String theSearchString, boolean caseSensitive,
65 boolean searchDescription);
68 * Returns the (possibly empty) list of sequences matched on sequence name or
73 List<SequenceI> getIdMatches();
76 * Answers the search results (possibly empty) from the last search
80 SearchResultsI getSearchResults();