KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > basic > BasicResultSetImpl


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/basic/BasicResultSetImpl.java,v 1.3 2004/07/28 09:35:02 ib Exp $
3  * $Revision: 1.3 $
4  * $Date: 2004/07/28 09:35:02 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23 package org.apache.slide.search.basic;
24
25 // import list
26
import java.util.HashSet JavaDoc;
27 import java.util.Collection JavaDoc;
28
29 /**
30  * An implementation of the {@link org.apache.slide.search.basic.IBasicResultSet
31  * IBasicResultSet} interface.
32  *
33  * @version $Revision: 1.3 $
34  *
35  **/

36 public class BasicResultSetImpl extends HashSet JavaDoc implements IBasicResultSet {
37     
38     /**
39      * Indicated if the result set is truncated for any reason.
40      */

41     protected boolean partial = false;
42     
43
44     /**
45      * Creates an empty BasicResultSetImpl.
46      */

47     public BasicResultSetImpl() {
48         this(false);
49     }
50     
51     /**
52      * Creates an empty BasicResultSetImpl and sets the value
53      * returned by {@link #isPartialResultSet isPartialResultSet()}.
54      *
55      * @param isPartialResult the value to be returned by
56      * {@link #isPartialResultSet isPartialResultSet()}.
57      */

58     public BasicResultSetImpl(boolean isPartialResult) {
59         super();
60         setPartialResultSet(isPartialResult);
61     }
62     
63     /**
64      * Creates a BasicResultSetImpl containing the elements of the given
65      * <code>collection</code>
66      *
67      * @param collection the Collection whose elements to add.
68      */

69     public BasicResultSetImpl(Collection JavaDoc collection) {
70         this(collection, false);
71     }
72     
73     /**
74      * Creates a BasicResultSetImpl containing the elements of the given
75      * <code>collection</code>
76      *
77      * @param collection the Collection whose elements to add.
78      * @param isPartialResult the value to be returned by
79      * {@link #isPartialResultSet isPartialResultSet()}.
80      */

81     public BasicResultSetImpl(Collection JavaDoc collection, boolean isPartialResult) {
82         super(collection);
83         setPartialResultSet(isPartialResult);
84     }
85     
86     
87     /**
88      * Returns <code>true</code> if the result set is truncated for any reason.
89      *
90      * @return <code>true</code> if the result set is truncated for any reason.
91      */

92     public boolean isPartialResultSet() {
93         return partial;
94     }
95     
96     /**
97      * Sets the value returned by {@link #isPartialResultSet isPartialResultSet()}.
98      *
99      * @param partial the new value to be returned by
100      * {@link #isPartialResultSet isPartialResultSet()}.
101      */

102     public void setPartialResultSet(boolean partial) {
103         this.partial = partial;
104     }
105 }
106
107
108
Popular Tags