01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * See the License for the specific language governing rights and
10: * limitations under the License.
11: *
12: * The Initial Developer of the Original Code is Simulacra Media Ltd.
13: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14: *
15: * All Rights Reserved.
16: *
17: * Contributor(s):
18: */
19: package org.openharmonise.vfs.search;
20:
21: import java.util.ArrayList;
22: import java.util.List;
23:
24: /**
25: * This class holds the information for a VirtualFileSystem search,
26: * content based, condition.
27: *
28: * @author Matthew Large
29: * @version $Revision: 1.1 $
30: *
31: */
32: public class ContentCondition {
33:
34: /**
35: * Condition operator.
36: */
37: private String m_sOperator = "contains";
38:
39: /**
40: * List of values.
41: */
42: private ArrayList m_aValues = new ArrayList(3);
43:
44: /**
45: * Constructs a new content condition.
46: *
47: * @param operator String defined operator for this condition, defaults to 'contains'
48: */
49: public ContentCondition(String operator) {
50: super ();
51: m_sOperator = operator;
52: }
53:
54: /**
55: * Sets the value.
56: *
57: * @param sValue Value
58: */
59: public void setValue(String sValue) {
60: this .m_aValues.add(sValue);
61: }
62:
63: /**
64: * Sets the values.
65: *
66: * @param aValues Values
67: */
68: public void setValue(List aValues) {
69: this .m_aValues.addAll(aValues);
70: }
71:
72: /**
73: * Returns the values.
74: *
75: * @return List of values
76: */
77: public List getValues() {
78: return (List) this .m_aValues.clone();
79: }
80:
81: /**
82: * Returns the operator.
83: *
84: * @return Operator
85: */
86: public String getOperator() {
87: return this.m_sOperator;
88: }
89:
90: }
|