KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > webdav > SearchCondition


1 /*
2  * (C) Copyright Simulacra Media Ltd, 2004. All rights reserved.
3  *
4  * The program is provided "AS IS" without any warranty express or
5  * implied, including the warranty of non-infringement and the implied
6  * warranties of merchantibility and fitness for a particular purpose.
7  * Simulacra Media Ltd will not be liable for any damages suffered by you as a result
8  * of using the Program. In no event will Simulacra Media Ltd be liable for any
9  * special, indirect or consequential damages or lost profits even if
10  * Simulacra Media Ltd has been advised of the possibility of their occurrence.
11  * Simulacra Media Ltd will not be liable for any third party claims against you.
12  */

13
14 package com.ibm.webdav;
15
16 import java.util.*;
17
18 /**
19  * @author Michael Bell
20  * @version $Revision: 1.1 $
21  */

22
23 public class SearchCondition {
24
25   protected Vector m_conditions = new Vector();
26   protected String JavaDoc m_sOperator = "and";
27
28   public SearchCondition() {
29   }
30
31   public void addCondition(SearchConditionTerm term) {
32     m_conditions.add(term);
33   }
34
35   public void addCondition(SearchCondition cond) {
36     m_conditions.add(cond);
37   }
38
39   public void setOperator(String JavaDoc sOp) {
40     m_sOperator = sOp;
41   }
42
43   public String JavaDoc getOperator() {
44     return m_sOperator;
45   }
46
47   public int size() {
48     return this.m_conditions.size();
49   }
50
51   public Object JavaDoc getCondition(int index) {
52     return m_conditions.elementAt(index);
53   }
54
55   public boolean isConditionLeaf(Object JavaDoc obj) {
56     return (obj instanceof SearchConditionTerm);
57   }
58
59   public boolean isConditionLeaf(int index) {
60     return isConditionLeaf(this.m_conditions.elementAt(index));
61   }
62
63 }
Popular Tags