JAL-3130 de-multi-release-jar.sh Script to make multi-release jar file single release.
[jalview.git] / src / jalview / binding / FeatureMatcher.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.binding;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class FeatureMatcher.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class FeatureMatcher implements java.io.Serializable
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _by.
31    */
32   private jalview.binding.types.FeatureMatcherByType _by;
33
34   /**
35    * name of feature attribute to filter on, or attribute and sub-attribute
36    */
37   private java.util.Vector _attributeNameList;
38
39   /**
40    * Field _condition.
41    */
42   private java.lang.String _condition;
43
44   /**
45    * Field _value.
46    */
47   private java.lang.String _value;
48
49   // ----------------/
50   // - Constructors -/
51   // ----------------/
52
53   public FeatureMatcher()
54   {
55     super();
56     this._attributeNameList = new java.util.Vector();
57   }
58
59   // -----------/
60   // - Methods -/
61   // -----------/
62
63   /**
64    * 
65    * 
66    * @param vAttributeName
67    * @throws java.lang.IndexOutOfBoundsException
68    *           if the index given is outside the bounds of the collection
69    */
70   public void addAttributeName(final java.lang.String vAttributeName)
71           throws java.lang.IndexOutOfBoundsException
72   {
73     // check for the maximum size
74     if (this._attributeNameList.size() >= 2)
75     {
76       throw new IndexOutOfBoundsException(
77               "addAttributeName has a maximum of 2");
78     }
79
80     this._attributeNameList.addElement(vAttributeName);
81   }
82
83   /**
84    * 
85    * 
86    * @param index
87    * @param vAttributeName
88    * @throws java.lang.IndexOutOfBoundsException
89    *           if the index given is outside the bounds of the collection
90    */
91   public void addAttributeName(final int index,
92           final java.lang.String vAttributeName)
93           throws java.lang.IndexOutOfBoundsException
94   {
95     // check for the maximum size
96     if (this._attributeNameList.size() >= 2)
97     {
98       throw new IndexOutOfBoundsException(
99               "addAttributeName has a maximum of 2");
100     }
101
102     this._attributeNameList.add(index, vAttributeName);
103   }
104
105   /**
106    * Method enumerateAttributeName.
107    * 
108    * @return an Enumeration over all java.lang.String elements
109    */
110   public java.util.Enumeration enumerateAttributeName()
111   {
112     return this._attributeNameList.elements();
113   }
114
115   /**
116    * Method getAttributeName.
117    * 
118    * @param index
119    * @throws java.lang.IndexOutOfBoundsException
120    *           if the index given is outside the bounds of the collection
121    * @return the value of the java.lang.String at the given index
122    */
123   public java.lang.String getAttributeName(final int index)
124           throws java.lang.IndexOutOfBoundsException
125   {
126     // check bounds for index
127     if (index < 0 || index >= this._attributeNameList.size())
128     {
129       throw new IndexOutOfBoundsException("getAttributeName: Index value '"
130               + index + "' not in range [0.."
131               + (this._attributeNameList.size() - 1) + "]");
132     }
133
134     return (java.lang.String) _attributeNameList.get(index);
135   }
136
137   /**
138    * Method getAttributeName.Returns the contents of the collection in an Array.
139    * <p>
140    * Note: Just in case the collection contents are changing in another thread,
141    * we pass a 0-length Array of the correct type into the API call. This way we
142    * <i>know</i> that the Array returned is of exactly the correct length.
143    * 
144    * @return this collection as an Array
145    */
146   public java.lang.String[] getAttributeName()
147   {
148     java.lang.String[] array = new java.lang.String[0];
149     return (java.lang.String[]) this._attributeNameList.toArray(array);
150   }
151
152   /**
153    * Method getAttributeNameCount.
154    * 
155    * @return the size of this collection
156    */
157   public int getAttributeNameCount()
158   {
159     return this._attributeNameList.size();
160   }
161
162   /**
163    * Returns the value of field 'by'.
164    * 
165    * @return the value of field 'By'.
166    */
167   public jalview.binding.types.FeatureMatcherByType getBy()
168   {
169     return this._by;
170   }
171
172   /**
173    * Returns the value of field 'condition'.
174    * 
175    * @return the value of field 'Condition'.
176    */
177   public java.lang.String getCondition()
178   {
179     return this._condition;
180   }
181
182   /**
183    * Returns the value of field 'value'.
184    * 
185    * @return the value of field 'Value'.
186    */
187   public java.lang.String getValue()
188   {
189     return this._value;
190   }
191
192   /**
193    * Method isValid.
194    * 
195    * @return true if this object is valid according to the schema
196    */
197   public boolean isValid()
198   {
199     try
200     {
201       validate();
202     } catch (org.exolab.castor.xml.ValidationException vex)
203     {
204       return false;
205     }
206     return true;
207   }
208
209   /**
210    * 
211    * 
212    * @param out
213    * @throws org.exolab.castor.xml.MarshalException
214    *           if object is null or if any SAXException is thrown during
215    *           marshaling
216    * @throws org.exolab.castor.xml.ValidationException
217    *           if this object is an invalid instance according to the schema
218    */
219   public void marshal(final java.io.Writer out)
220           throws org.exolab.castor.xml.MarshalException,
221           org.exolab.castor.xml.ValidationException
222   {
223     Marshaller.marshal(this, out);
224   }
225
226   /**
227    * 
228    * 
229    * @param handler
230    * @throws java.io.IOException
231    *           if an IOException occurs during marshaling
232    * @throws org.exolab.castor.xml.ValidationException
233    *           if this object is an invalid instance according to the schema
234    * @throws org.exolab.castor.xml.MarshalException
235    *           if object is null or if any SAXException is thrown during
236    *           marshaling
237    */
238   public void marshal(final org.xml.sax.ContentHandler handler)
239           throws java.io.IOException,
240           org.exolab.castor.xml.MarshalException,
241           org.exolab.castor.xml.ValidationException
242   {
243     Marshaller.marshal(this, handler);
244   }
245
246   /**
247    */
248   public void removeAllAttributeName()
249   {
250     this._attributeNameList.clear();
251   }
252
253   /**
254    * Method removeAttributeName.
255    * 
256    * @param vAttributeName
257    * @return true if the object was removed from the collection.
258    */
259   public boolean removeAttributeName(final java.lang.String vAttributeName)
260   {
261     boolean removed = _attributeNameList.remove(vAttributeName);
262     return removed;
263   }
264
265   /**
266    * Method removeAttributeNameAt.
267    * 
268    * @param index
269    * @return the element removed from the collection
270    */
271   public java.lang.String removeAttributeNameAt(final int index)
272   {
273     java.lang.Object obj = this._attributeNameList.remove(index);
274     return (java.lang.String) obj;
275   }
276
277   /**
278    * 
279    * 
280    * @param index
281    * @param vAttributeName
282    * @throws java.lang.IndexOutOfBoundsException
283    *           if the index given is outside the bounds of the collection
284    */
285   public void setAttributeName(final int index,
286           final java.lang.String vAttributeName)
287           throws java.lang.IndexOutOfBoundsException
288   {
289     // check bounds for index
290     if (index < 0 || index >= this._attributeNameList.size())
291     {
292       throw new IndexOutOfBoundsException("setAttributeName: Index value '"
293               + index + "' not in range [0.."
294               + (this._attributeNameList.size() - 1) + "]");
295     }
296
297     this._attributeNameList.set(index, vAttributeName);
298   }
299
300   /**
301    * 
302    * 
303    * @param vAttributeNameArray
304    */
305   public void setAttributeName(final java.lang.String[] vAttributeNameArray)
306   {
307     // -- copy array
308     _attributeNameList.clear();
309
310     for (int i = 0; i < vAttributeNameArray.length; i++)
311     {
312       this._attributeNameList.add(vAttributeNameArray[i]);
313     }
314   }
315
316   /**
317    * Sets the value of field 'by'.
318    * 
319    * @param by
320    *          the value of field 'by'.
321    */
322   public void setBy(final jalview.binding.types.FeatureMatcherByType by)
323   {
324     this._by = by;
325   }
326
327   /**
328    * Sets the value of field 'condition'.
329    * 
330    * @param condition
331    *          the value of field 'condition'.
332    */
333   public void setCondition(final java.lang.String condition)
334   {
335     this._condition = condition;
336   }
337
338   /**
339    * Sets the value of field 'value'.
340    * 
341    * @param value
342    *          the value of field 'value'.
343    */
344   public void setValue(final java.lang.String value)
345   {
346     this._value = value;
347   }
348
349   /**
350    * Method unmarshal.
351    * 
352    * @param reader
353    * @throws org.exolab.castor.xml.MarshalException
354    *           if object is null or if any SAXException is thrown during
355    *           marshaling
356    * @throws org.exolab.castor.xml.ValidationException
357    *           if this object is an invalid instance according to the schema
358    * @return the unmarshaled jalview.binding.FeatureMatcher
359    */
360   public static jalview.binding.FeatureMatcher unmarshal(
361           final java.io.Reader reader)
362           throws org.exolab.castor.xml.MarshalException,
363           org.exolab.castor.xml.ValidationException
364   {
365     return (jalview.binding.FeatureMatcher) Unmarshaller
366             .unmarshal(jalview.binding.FeatureMatcher.class, reader);
367   }
368
369   /**
370    * 
371    * 
372    * @throws org.exolab.castor.xml.ValidationException
373    *           if this object is an invalid instance according to the schema
374    */
375   public void validate() throws org.exolab.castor.xml.ValidationException
376   {
377     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
378     validator.validate(this);
379   }
380
381 }