KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > basic > expression > EmptyExpression


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/basic/expression/EmptyExpression.java,v 1.5 2004/07/28 09:34:50 ib Exp $
3  * $Revision: 1.5 $
4  * $Date: 2004/07/28 09:34:50 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 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
24 package org.apache.slide.search.basic.expression;
25
26 import org.apache.slide.search.SearchException;
27 import org.apache.slide.search.basic.BasicResultSetImpl;
28 import org.apache.slide.search.basic.ComparableResourcesPool;
29 import org.apache.slide.search.basic.IBasicExpression;
30 import org.apache.slide.search.basic.IBasicExpressionFactory;
31 import org.apache.slide.search.basic.IBasicResultSet;
32
33 /**
34  * Represents an AND expression.
35  *
36  * @version $Revision: 1.5 $
37  */

38 public class EmptyExpression implements IBasicExpression {
39     
40     /**
41      * The pool of resources to apply the expression to.
42      */

43     protected ComparableResourcesPool requestedResourcesPool = null;
44     
45     private IBasicExpressionFactory factory;
46     
47     /**
48      * Creates an empty expression. This occurs when no <where> clause
49      * was supplied
50      *
51      * @param requestedResourcesPool the pool of resources to apply the expression to.
52      */

53     public EmptyExpression (ComparableResourcesPool requestedResourcesPool) {
54         this.requestedResourcesPool = requestedResourcesPool;
55     }
56     
57     /**
58      * Executes the expression.
59      *
60      * @return a Set of RequestedResource objects
61      *
62      * @throws SearchException
63      */

64     public IBasicResultSet execute () throws SearchException {
65         return new BasicResultSetImpl(requestedResourcesPool.getPool(),
66                                       requestedResourcesPool.partialResult());
67     }
68     
69     /**
70      * Method setFactory
71      *
72      * @param factory an IBasicExpressionFactory
73      *
74      */

75     public void setFactory (IBasicExpressionFactory factory) {
76         this.factory = factory;
77     }
78     
79     /**
80      * Method getFactory
81      *
82      * @return an IBasicExpressionFactory
83      *
84      */

85     public IBasicExpressionFactory getFactory() {
86         return this.factory;
87     }
88     
89     
90     
91     /**
92      * String representation for debugging purposes.
93      *
94      * @return this expression as String
95      */

96     public String JavaDoc toString () {
97         return "";
98     }
99     
100 }
101
102
Popular Tags