OSDN Git Service

Add logic to display stacks in notebook tree
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / filters / EnSearch.java
1 /*\r
2  * This file is part of NeverNote \r
3  * Copyright 2009 Randy Baumgarte\r
4  * \r
5  * This file may be licensed under the terms of of the\r
6  * GNU General Public License Version 2 (the ``GPL'').\r
7  *\r
8  * Software distributed under the License is distributed\r
9  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either\r
10  * express or implied. See the GPL for the specific language\r
11  * governing rights and limitations.\r
12  *\r
13  * You should have received a copy of the GPL along with this\r
14  * program. If not, go to http://www.gnu.org/licenses/gpl.html\r
15  * or write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
17  *\r
18 */\r
19 \r
20 \r
21 package cx.fbn.nevernote.filters;\r
22 \r
23 import java.util.List;\r
24 \r
25 import com.evernote.edam.type.Note;\r
26 import com.evernote.edam.type.Tag;\r
27 \r
28 import cx.fbn.nevernote.sql.DatabaseConnection;\r
29 import cx.fbn.nevernote.sql.REnSearch;\r
30 import cx.fbn.nevernote.utilities.ApplicationLogger;\r
31 \r
32 public class EnSearch {\r
33         \r
34 \r
35         private List<Note>                      matches;\r
36         public List<String>                     hilightWords;\r
37         \r
38         public EnSearch(DatabaseConnection conn, ApplicationLogger logger, String s, List<Tag> t, int len, int weight) {\r
39                 if (s == null) \r
40                         return;\r
41                 if (s.trim().equals(""))\r
42                         return;\r
43                 \r
44                 matches = null;\r
45                 REnSearch request = new REnSearch(conn, logger, s, t, len, weight);\r
46                 matches = request.matchWords();\r
47                 hilightWords = request.getWords();\r
48         }\r
49                 \r
50         public List<Note> matchWords() {\r
51                 return matches;\r
52         }\r
53         \r
54 \r
55 \r
56         \r
57 }\r