KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnet > Search > SearchRequest


1 /*
2  * SearchRequest.java
3  *
4  * Created on 28. duben 2004, 15:18
5  */

6
7 package SOFA.SOFAnet.Search;
8
9 import java.util.List JavaDoc;
10
11 /**
12  * Data structure for I/O of search request.
13  *
14  * @author Ladislav Sobr
15  */

16 public class SearchRequest
17 {
18   private SearchPattern searchPattern; //request itself
19

20   //other input concerning search network
21
private boolean firstOnly; //wheter take only one (first) satisfying reply
22
private String JavaDoc shareGroup; //name of share group that we should search through (empty string means "all")
23
private int timeout; //maximal time in milliseconds to wait for the reply(ies)
24

25   //output
26
private int errCode;
27   private List JavaDoc replies; //list of SearchReplyItem objects
28

29   /** Creates a new instance of SearchRequest */
30   public SearchRequest()
31   {
32     firstOnly = true;
33     shareGroup = "";
34     timeout = 5000;
35     errCode = -1;
36     replies = null;
37   }
38
39   public SearchPattern getSearchPattern()
40   {
41     return searchPattern;
42   }
43   
44   public boolean getFirstOnly()
45   {
46     return firstOnly;
47   }
48   
49   public String JavaDoc getShareGroup()
50   {
51     return shareGroup;
52   }
53   
54   public int getTimeout()
55   {
56     return timeout;
57   }
58   
59   public int getErrCode()
60   {
61     return errCode;
62   }
63   
64   public List JavaDoc getReplies()
65   {
66     return replies;
67   }
68   
69   public void setSearchPattern(SearchPattern searchPattern)
70   {
71     this.searchPattern = searchPattern;
72   }
73   
74   public void setFirstOnly(boolean firstOnly)
75   {
76     this.firstOnly = firstOnly;
77   }
78   
79   public void setShareGroup(String JavaDoc shareGroup)
80   {
81     this.shareGroup = shareGroup;
82   }
83   
84   public void setTimeout(int timeout)
85   {
86     this.timeout = timeout;
87   }
88   
89   public void setErrCode(int errCode)
90   {
91     this.errCode = errCode;
92   }
93   
94   public void setReplies(List JavaDoc replies)
95   {
96     this.replies = replies;
97   }
98 }
99
Popular Tags