Source code: org/acs/damsel/srvr/search/AdvancedSearchParams.java
1 package org.acs.damsel.srvr.search;
2
3 import java.util.*;
4
5 /**
6 *
7 * <p>Title: AdavancedSearchParams</p>
8 * <p>Description: Instances of this object are used in advanced searching. The
9 * object stores the collection to be searched as well as four vectors
10 * containing search pairs for each of the four different types of advanced
11 * searches (all words, any words, exact phrase, without words).</p>
12 * @version 1.0
13 */
14 public class AdvancedSearchParams {
15 private String collectionName;
16 private Vector allSearch;
17 private Vector exactSearch;
18 private Vector anySearch;
19 private Vector notSearch;
20
21 /**
22 * Default constructor initializes all of the vectors but does not set a
23 * collection name.
24 */
25 public AdvancedSearchParams() {
26 allSearch = new Vector();
27 exactSearch = new Vector();
28 anySearch = new Vector();
29 notSearch = new Vector();
30 }
31
32 /**
33 * Method to add a search pair to the all search vector
34 * @param sp is a search pair of a search value and a search field
35 */
36 public void addAllSearchPair(SearchPair sp) {
37 this.allSearch.add(sp);
38 }
39
40 /**
41 * Method to add a search pair to the any search vector
42 * @param sp is a search pair of a search value and a search field
43 */
44 public void addAnySearchPair(SearchPair sp) {
45 this.anySearch.add(sp);
46 }
47
48 /**
49 * Method to add a search pair to the exact search vector
50 * @param sp is a search pair of a search value and a search field
51 */
52 public void addExactSearchPair(SearchPair sp) {
53 this.exactSearch.add(sp);
54 }
55
56 /**
57 * Method to add a search pair to the not search vector
58 * @param sp is a search pair of a search value and a search field
59 */
60 public void addNotSearchPair(SearchPair sp) {
61 this.notSearch.add(sp);
62 }
63
64 /* getters and setters */
65 public String getCollectionName() {
66 return collectionName;
67 }
68 public void setCollectionName(String collectionName) {
69 this.collectionName = collectionName;
70 }
71 public Vector getAllSearch() {
72 return allSearch;
73 }
74 public void setAllSearch(Vector allSearch) {
75 this.allSearch = allSearch;
76 }
77 public Vector getExactSearch() {
78 return exactSearch;
79 }
80 public void setExactSearch(Vector exactSearch) {
81 this.exactSearch = exactSearch;
82 }
83 public Vector getAnySearch() {
84 return anySearch;
85 }
86 public void setAnySearch(Vector anySearch) {
87 this.anySearch = anySearch;
88 }
89 public Vector getNotSearch() {
90 return notSearch;
91 }
92 public void setNotSearch(Vector notSearch) {
93 this.notSearch = notSearch;
94 }
95 }