KickJava   Java API By Example, From Geeks To Geeks.

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


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  * property based, condition.
27  *
28  * @author Matthew Large
29  * @version $Revision: 1.1 $
30  *
31  */

32 public class PropertyCondition {
33
34     /**
35      * Namespace of property.
36      */

37     private String JavaDoc m_sPropNamespace = null;
38     
39     /**
40      * Name of property.
41      */

42     private String JavaDoc m_sPropName = null;
43     
44     /**
45      * Operator.
46      */

47     private String JavaDoc m_sOperator = "=";
48     
49     /**
50      * List of values.
51      */

52     private ArrayList JavaDoc m_aValues = new ArrayList JavaDoc(3);
53
54     /**
55      * Constructs a new property condition.
56      *
57      * @param sPropNamespace Namespace of property to be searched on
58      * @param sPropName Name of property to be searched on
59      * @param operator Operator for this condition, defaults to '='
60      */

61     public PropertyCondition(String JavaDoc sPropNamespace, String JavaDoc sPropName, String JavaDoc operator) {
62         super();
63         this.m_sPropNamespace = sPropNamespace;
64         this.m_sPropName = sPropName;
65         m_sOperator = operator;
66     }
67     
68     /**
69      * Sets the value of this condition.
70      *
71      * @param sValue Value
72      */

73     public void setValue(String JavaDoc sValue) {
74         this.m_aValues.add(sValue);
75     }
76     
77     /**
78      * Sets a list of values for this condition.
79      *
80      * @param aValues List of values
81      */

82     public void setValue(List JavaDoc aValues) {
83         this.m_aValues.addAll(aValues);
84     }
85     
86     /**
87      * Returns a list of value for this condition.
88      *
89      * @return List of values
90      */

91     public List JavaDoc getValues() {
92         return (List JavaDoc)this.m_aValues.clone();
93     }
94
95     /**
96      * Returns the operator for this condition.
97      *
98      * @return Operator
99      */

100     public String JavaDoc getOperator() {
101         return this.m_sOperator;
102     }
103     
104     /**
105      * Returns the namespace of the property.
106      *
107      * @return Namespace
108      */

109     public String JavaDoc getPropNamespaceURI() {
110         return this.m_sPropNamespace;
111     }
112     
113     /**
114      * Returns the name of the property.
115      *
116      * @return Name
117      */

118     public String JavaDoc getPropName() {
119         return this.m_sPropName;
120     }
121
122 }
123
Popular Tags