KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > search > EmptyResultSet


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.search;
18
19 import java.util.ArrayList JavaDoc;
20 import java.util.Collections JavaDoc;
21 import java.util.Iterator JavaDoc;
22 import java.util.List JavaDoc;
23
24 import org.alfresco.service.cmr.repository.ChildAssociationRef;
25 import org.alfresco.service.cmr.repository.NodeRef;
26 import org.alfresco.service.cmr.repository.Path;
27 import org.alfresco.service.cmr.search.LimitBy;
28 import org.alfresco.service.cmr.search.PermissionEvaluationMode;
29 import org.alfresco.service.cmr.search.ResultSet;
30 import org.alfresco.service.cmr.search.ResultSetMetaData;
31 import org.alfresco.service.cmr.search.ResultSetRow;
32 import org.alfresco.service.cmr.search.SearchParameters;
33
34 public class EmptyResultSet implements ResultSet
35 {
36
37     public EmptyResultSet()
38     {
39         super();
40     }
41
42     public Path[] getPropertyPaths()
43     {
44        return new Path[]{};
45     }
46
47     public int length()
48     {
49         return 0;
50     }
51
52     public NodeRef getNodeRef(int n)
53     {
54         throw new UnsupportedOperationException JavaDoc();
55     }
56
57     public float getScore(int n)
58     {
59         throw new UnsupportedOperationException JavaDoc();
60     }
61
62     public Iterator JavaDoc<ResultSetRow> iterator()
63     {
64         ArrayList JavaDoc<ResultSetRow> dummy = new ArrayList JavaDoc<ResultSetRow>(0);
65         return dummy.iterator();
66     }
67
68     public void close()
69     {
70
71     }
72
73     public ResultSetRow getRow(int i)
74     {
75         // TODO Auto-generated method stub
76
throw new UnsupportedOperationException JavaDoc();
77     }
78
79     public List JavaDoc<NodeRef> getNodeRefs()
80     {
81         return Collections.<NodeRef>emptyList();
82     }
83
84     public List JavaDoc<ChildAssociationRef> getChildAssocRefs()
85     {
86         return Collections.<ChildAssociationRef>emptyList();
87     }
88
89     public ChildAssociationRef getChildAssocRef(int n)
90     {
91         // TODO Auto-generated method stub
92
throw new UnsupportedOperationException JavaDoc();
93     }
94
95     public ResultSetMetaData getResultSetMetaData()
96     {
97         return new SimpleResultSetMetaData(LimitBy.UNLIMITED, PermissionEvaluationMode.EAGER, new SearchParameters());
98     }
99 }
100
Popular Tags