1
2 package hoplugins.teamAnalyzer.vo;
3
4 import java.util.ArrayList;
5 import java.util.List;
6
7
8 /***
9 * Filter Object class that holds the user settings for selecting analyzed matches
10 *
11 * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
12 */
13 public class Filter {
14
15
16 /*** List of manually selected match ids */
17 private List matches;
18
19 /*** Automatic or manual selection enabled */
20 private boolean automatic;
21
22 /*** Consider away games */
23 private boolean awayGames;
24
25 /*** Consider cup games */
26 private boolean cup;
27
28 /*** Consider lost games */
29 private boolean defeat;
30
31 /*** Consider draw games */
32 private boolean draw;
33
34 /*** Consider friendly games */
35 private boolean friendly;
36
37 /*** Consider home games */
38 private boolean homeGames;
39
40 /*** Consider league games */
41 private boolean league;
42
43 /*** Consider qualifier games */
44 private boolean qualifier;
45
46 /*** Consider won games */
47 private boolean win;
48
49 /*** Maximum number of games */
50 private int number;
51
52
53
54 /***
55 * Creates a new Filter object.
56 */
57 public Filter() {
58 automatic = true;
59 setNumber(10);
60 setAwayGames(true);
61 setHomeGames(true);
62 setWin(true);
63 setDefeat(true);
64 setDraw(true);
65 setLeague(true);
66 setCup(false);
67 setFriendly(false);
68 setQualifier(false);
69 matches = new ArrayList();
70 }
71
72
73
74 /***
75 * DOCUMENT ME!
76 *
77 * @param b
78 */
79 public void setAutomatic(boolean b) {
80 automatic = b;
81 }
82
83 /***
84 * DOCUMENT ME!
85 *
86 * @return
87 */
88 public boolean isAutomatic() {
89 return automatic;
90 }
91
92 /***
93 * DOCUMENT ME!
94 *
95 * @param b
96 */
97 public void setAwayGames(boolean b) {
98 awayGames = b;
99 }
100
101 /***
102 * DOCUMENT ME!
103 *
104 * @return
105 */
106 public boolean isAwayGames() {
107 return awayGames;
108 }
109
110 /***
111 * Document Me!
112 *
113 * @param b
114 */
115 public void setCup(boolean b) {
116 cup = b;
117 }
118
119 /***
120 * Document Me!
121 *
122 * @return
123 */
124 public boolean isCup() {
125 return cup;
126 }
127
128 /***
129 * DOCUMENT ME!
130 *
131 * @param b
132 */
133 public void setDefeat(boolean b) {
134 defeat = b;
135 }
136
137 /***
138 * DOCUMENT ME!
139 *
140 * @return
141 */
142 public boolean isDefeat() {
143 return defeat;
144 }
145
146 /***
147 * DOCUMENT ME!
148 *
149 * @param b
150 */
151 public void setDraw(boolean b) {
152 draw = b;
153 }
154
155 /***
156 * DOCUMENT ME!
157 *
158 * @return
159 */
160 public boolean isDraw() {
161 return draw;
162 }
163
164 /***
165 * Document Me!
166 *
167 * @param b
168 */
169 public void setFriendly(boolean b) {
170 friendly = b;
171 }
172
173 /***
174 * Document Me!
175 *
176 * @return
177 */
178 public boolean isFriendly() {
179 return friendly;
180 }
181
182 /***
183 * DOCUMENT ME!
184 *
185 * @param b
186 */
187 public void setHomeGames(boolean b) {
188 homeGames = b;
189 }
190
191 /***
192 * DOCUMENT ME!
193 *
194 * @return
195 */
196 public boolean isHomeGames() {
197 return homeGames;
198 }
199
200 /***
201 * Document Me!
202 *
203 * @param b
204 */
205 public void setLeague(boolean b) {
206 league = b;
207 }
208
209 /***
210 * Document Me!
211 *
212 * @return
213 */
214 public boolean isLeague() {
215 return league;
216 }
217
218 /***
219 * DOCUMENT ME!
220 *
221 * @param list
222 */
223 public void setMatches(List list) {
224 matches = list;
225 }
226
227 /***
228 * DOCUMENT ME!
229 *
230 * @return
231 */
232 public List getMatches() {
233 return matches;
234 }
235
236 /***
237 * DOCUMENT ME!
238 *
239 * @param i
240 */
241 public void setNumber(int i) {
242 number = i;
243 }
244
245 /***
246 * DOCUMENT ME!
247 *
248 * @return
249 */
250 public int getNumber() {
251 return number;
252 }
253
254 /***
255 * Document Me!
256 *
257 * @param b
258 */
259 public void setQualifier(boolean b) {
260 qualifier = b;
261 }
262
263 /***
264 * Document Me!
265 *
266 * @return
267 */
268 public boolean isQualifier() {
269 return qualifier;
270 }
271
272 /***
273 * DOCUMENT ME!
274 *
275 * @param b
276 */
277 public void setWin(boolean b) {
278 win = b;
279 }
280
281 /***
282 * DOCUMENT ME!
283 *
284 * @return
285 */
286 public boolean isWin() {
287 return win;
288 }
289
290 /***
291 * toString methode: creates a String representation of the object
292 *
293 * @return the String representation
294 */
295 public String toString() {
296 StringBuffer buffer = new StringBuffer();
297
298 buffer.append("Filter[");
299 buffer.append("number = " + number);
300 buffer.append(", awayGames = " + awayGames);
301 buffer.append(", homeGames = " + homeGames);
302 buffer.append(", win = " + win);
303 buffer.append(", draw = " + draw);
304 buffer.append(", defeat = " + defeat);
305 buffer.append(", automatic = " + automatic);
306 buffer.append(", matches = " + matches);
307 buffer.append("]");
308
309 return buffer.toString();
310 }
311 }