01: /*
02: * (C) Copyright Simulacra Media Ltd, 2004. All rights reserved.
03: *
04: * The program is provided "AS IS" without any warranty express or
05: * implied, including the warranty of non-infringement and the implied
06: * warranties of merchantibility and fitness for a particular purpose.
07: * Simulacra Media Ltd will not be liable for any damages suffered by you as a result
08: * of using the Program. In no event will Simulacra Media Ltd be liable for any
09: * 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 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 sOp) {
40: m_sOperator = sOp;
41: }
42:
43: public String getOperator() {
44: return m_sOperator;
45: }
46:
47: public int size() {
48: return this .m_conditions.size();
49: }
50:
51: public Object getCondition(int index) {
52: return m_conditions.elementAt(index);
53: }
54:
55: public boolean isConditionLeaf(Object 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: }
|