1 |
/************************************************************************************************* |
2 |
* Java interface of Hyper Estraier |
3 |
* Copyright (C) 2004-2005 Mikio Hirabayashi |
4 |
* All rights reserved. |
5 |
* This file is part of Hyper Estraier. |
6 |
* Redistribution and use in source and binary forms, with or without modification, are |
7 |
* permitted provided that the following conditions are met: |
8 |
* |
9 |
* * Redistributions of source code must retain the above copyright notice, this list of |
10 |
* conditions and the following disclaimer. |
11 |
* * Redistributions in binary form must reproduce the above copyright notice, this list of |
12 |
* conditions and the following disclaimer in the documentation and/or other materials |
13 |
* provided with the distribution. |
14 |
* * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to |
15 |
* endorse or promote products derived from this software without specific prior written |
16 |
* permission. |
17 |
* |
18 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
19 |
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
20 |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
21 |
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
22 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
23 |
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
25 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
26 |
* OF THE POSSIBILITY OF SUCH DAMAGE. |
27 |
*************************************************************************************************/ |
28 |
|
29 |
|
30 |
package estraier; |
31 |
|
32 |
|
33 |
|
34 |
/** |
35 |
* Abstraction of search condition. |
36 |
*/ |
37 |
public interface Condition { |
38 |
//---------------------------------------------------------------- |
39 |
// public constants |
40 |
//---------------------------------------------------------------- |
41 |
/** option: check every N-gram key */ |
42 |
int CONDSURE = 1 << 0; |
43 |
/** option: check N-gram keys skipping by one */ |
44 |
int CONDUSU = 1 << 1; |
45 |
/** option: check N-gram keys skipping by two */ |
46 |
int CONDFAST = 1 << 2; |
47 |
/** option: check N-gram keys skipping by three */ |
48 |
int CONDAGIT = 1 << 3; |
49 |
/** option: without TF-IDF tuning */ |
50 |
int CONDNOIDF = 1 << 4; |
51 |
/** option: with the simplefied phrase */ |
52 |
int CONDSIMPLE = 1 << 10; |
53 |
//---------------------------------------------------------------- |
54 |
// public methods |
55 |
//---------------------------------------------------------------- |
56 |
/** |
57 |
* Set the search phrase. |
58 |
* @param phrase a search phrase. |
59 |
*/ |
60 |
void set_phrase(String phrase); |
61 |
/** |
62 |
* Add an expression for an attribute. |
63 |
* @param expr an expression for an attribute. |
64 |
*/ |
65 |
void add_attr(String expr); |
66 |
/** |
67 |
* Set the order. |
68 |
* @param expr an expression for the order. |
69 |
*/ |
70 |
void set_order(String expr); |
71 |
/** |
72 |
* Set the maximum number of retrieval. |
73 |
* @param max the maximum number of retrieval. |
74 |
*/ |
75 |
void set_max(int max); |
76 |
/** |
77 |
* Set options of retrieval. |
78 |
* @param options options by bitwise or. |
79 |
*/ |
80 |
void set_options(int options); |
81 |
/** |
82 |
* Get the search phrase. |
83 |
* @return the search phrase. |
84 |
*/ |
85 |
String phrase(); |
86 |
/** |
87 |
* Get expressions for attributes. |
88 |
* @return expressions for attributes. |
89 |
*/ |
90 |
java.util.List attrs(); |
91 |
/** |
92 |
* Get the order expression. |
93 |
* @return the order expression. |
94 |
*/ |
95 |
String order(); |
96 |
/** |
97 |
* Get the maximum number of retrieval. |
98 |
* @return the maximum number of retrieval. |
99 |
*/ |
100 |
int max(); |
101 |
/** |
102 |
* Get options of retrieval of a condition object. |
103 |
* @return options by bitwise or. |
104 |
*/ |
105 |
int options(); |
106 |
}; |
107 |
|
108 |
|
109 |
|
110 |
/* END OF FILE */ |