KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > vfs > search > ContentCondition


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * 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 JavaDoc;
22 import java.util.List JavaDoc;
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 JavaDoc m_sOperator = "contains";
38     
39     /**
40      * List of values.
41      */

42     private ArrayList JavaDoc m_aValues = new ArrayList JavaDoc(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 JavaDoc 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 JavaDoc 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 JavaDoc aValues) {
69         this.m_aValues.addAll(aValues);
70     }
71     
72     /**
73      * Returns the values.
74      *
75      * @return List of values
76      */

77     public List JavaDoc getValues() {
78         return (List JavaDoc)this.m_aValues.clone();
79     }
80
81     /**
82      * Returns the operator.
83      *
84      * @return Operator
85      */

86     public String JavaDoc getOperator() {
87         return this.m_sOperator;
88     }
89
90 }
91
Free Books   Free Magazines  
Popular Tags