KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/basic/expression/AndExpression.java,v 1.4 2004/07/28 09:34:50 ib Exp $
3  * $Revision: 1.4 $
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
25
26 package org.apache.slide.search.basic.expression;
27 import java.util.Collection JavaDoc;
28
29 import org.apache.slide.search.InvalidQueryException;
30 import org.apache.slide.search.basic.IBasicResultSet;
31 import org.apache.slide.search.basic.Literals;
32 import org.jdom.Element;
33
34 /**
35  * Represents an AND expression.
36  *
37  * @version $Revision: 1.4 $
38  */

39 public class AndExpression extends MergeExpression {
40     
41     
42     /**
43      * Creates an AND expression according to Element e
44      *
45      * @param e jdom element, that describes the expression
46      * @param expressionsToMerge a Collection of IBasicExpressions to merge.
47      */

48     public AndExpression (Element e, Collection JavaDoc expressionsToMerge) throws InvalidQueryException {
49         super (e, expressionsToMerge);
50     }
51     
52     protected void merge (IBasicResultSet theOtherResultSet) {
53         resultSet.retainAll (theOtherResultSet);
54     }
55         
56     
57     /**
58      * String representation for debugging purposes.
59      *
60      * @return this expression as String
61      */

62     public String JavaDoc toString () {
63         return super.toString (Literals.AND);
64     }
65
66 }
67
68
Popular Tags