8605dc5b665d701ae3b117a413a5a4471106bbf3
[jalview.git] / src / jalview / schemabinding / version2 / VAMSAS.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.schemabinding.version2;
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 VAMSAS.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class VAMSAS implements java.io.Serializable {
23
24
25       //--------------------------/
26      //- Class/Member Variables -/
27     //--------------------------/
28
29     /**
30      * Field _treeList.
31      */
32     private java.util.Vector _treeList;
33
34     /**
35      * Field _sequenceSetList.
36      */
37     private java.util.Vector _sequenceSetList;
38
39
40       //----------------/
41      //- Constructors -/
42     //----------------/
43
44     public VAMSAS() {
45         super();
46         this._treeList = new java.util.Vector();
47         this._sequenceSetList = new java.util.Vector();
48     }
49
50
51       //-----------/
52      //- Methods -/
53     //-----------/
54
55     /**
56      * 
57      * 
58      * @param vSequenceSet
59      * @throws java.lang.IndexOutOfBoundsException if the index
60      * given is outside the bounds of the collection
61      */
62     public void addSequenceSet(
63             final jalview.schemabinding.version2.SequenceSet vSequenceSet)
64     throws java.lang.IndexOutOfBoundsException {
65         this._sequenceSetList.addElement(vSequenceSet);
66     }
67
68     /**
69      * 
70      * 
71      * @param index
72      * @param vSequenceSet
73      * @throws java.lang.IndexOutOfBoundsException if the index
74      * given is outside the bounds of the collection
75      */
76     public void addSequenceSet(
77             final int index,
78             final jalview.schemabinding.version2.SequenceSet vSequenceSet)
79     throws java.lang.IndexOutOfBoundsException {
80         this._sequenceSetList.add(index, vSequenceSet);
81     }
82
83     /**
84      * 
85      * 
86      * @param vTree
87      * @throws java.lang.IndexOutOfBoundsException if the index
88      * given is outside the bounds of the collection
89      */
90     public void addTree(
91             final java.lang.String vTree)
92     throws java.lang.IndexOutOfBoundsException {
93         this._treeList.addElement(vTree);
94     }
95
96     /**
97      * 
98      * 
99      * @param index
100      * @param vTree
101      * @throws java.lang.IndexOutOfBoundsException if the index
102      * given is outside the bounds of the collection
103      */
104     public void addTree(
105             final int index,
106             final java.lang.String vTree)
107     throws java.lang.IndexOutOfBoundsException {
108         this._treeList.add(index, vTree);
109     }
110
111     /**
112      * Method enumerateSequenceSet.
113      * 
114      * @return an Enumeration over all
115      * jalview.schemabinding.version2.SequenceSet elements
116      */
117     public java.util.Enumeration enumerateSequenceSet(
118     ) {
119         return this._sequenceSetList.elements();
120     }
121
122     /**
123      * Method enumerateTree.
124      * 
125      * @return an Enumeration over all java.lang.String elements
126      */
127     public java.util.Enumeration enumerateTree(
128     ) {
129         return this._treeList.elements();
130     }
131
132     /**
133      * Method getSequenceSet.
134      * 
135      * @param index
136      * @throws java.lang.IndexOutOfBoundsException if the index
137      * given is outside the bounds of the collection
138      * @return the value of the
139      * jalview.schemabinding.version2.SequenceSet at the given index
140      */
141     public jalview.schemabinding.version2.SequenceSet getSequenceSet(
142             final int index)
143     throws java.lang.IndexOutOfBoundsException {
144         // check bounds for index
145         if (index < 0 || index >= this._sequenceSetList.size()) {
146             throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
147         }
148         
149         return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList.get(index);
150     }
151
152     /**
153      * Method getSequenceSet.Returns the contents of the collection
154      * in an Array.  <p>Note:  Just in case the collection contents
155      * are changing in another thread, we pass a 0-length Array of
156      * the correct type into the API call.  This way we <i>know</i>
157      * that the Array returned is of exactly the correct length.
158      * 
159      * @return this collection as an Array
160      */
161     public jalview.schemabinding.version2.SequenceSet[] getSequenceSet(
162     ) {
163         jalview.schemabinding.version2.SequenceSet[] array = new jalview.schemabinding.version2.SequenceSet[0];
164         return (jalview.schemabinding.version2.SequenceSet[]) this._sequenceSetList.toArray(array);
165     }
166
167     /**
168      * Method getSequenceSetCount.
169      * 
170      * @return the size of this collection
171      */
172     public int getSequenceSetCount(
173     ) {
174         return this._sequenceSetList.size();
175     }
176
177     /**
178      * Method getTree.
179      * 
180      * @param index
181      * @throws java.lang.IndexOutOfBoundsException if the index
182      * given is outside the bounds of the collection
183      * @return the value of the java.lang.String at the given index
184      */
185     public java.lang.String getTree(
186             final int index)
187     throws java.lang.IndexOutOfBoundsException {
188         // check bounds for index
189         if (index < 0 || index >= this._treeList.size()) {
190             throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
191         }
192         
193         return (java.lang.String) _treeList.get(index);
194     }
195
196     /**
197      * Method getTree.Returns the contents of the collection in an
198      * Array.  <p>Note:  Just in case the collection contents are
199      * changing in another thread, we pass a 0-length Array of the
200      * correct type into the API call.  This way we <i>know</i>
201      * that the Array returned is of exactly the correct length.
202      * 
203      * @return this collection as an Array
204      */
205     public java.lang.String[] getTree(
206     ) {
207         java.lang.String[] array = new java.lang.String[0];
208         return (java.lang.String[]) this._treeList.toArray(array);
209     }
210
211     /**
212      * Method getTreeCount.
213      * 
214      * @return the size of this collection
215      */
216     public int getTreeCount(
217     ) {
218         return this._treeList.size();
219     }
220
221     /**
222      * Method isValid.
223      * 
224      * @return true if this object is valid according to the schema
225      */
226     public boolean isValid(
227     ) {
228         try {
229             validate();
230         } catch (org.exolab.castor.xml.ValidationException vex) {
231             return false;
232         }
233         return true;
234     }
235
236     /**
237      * 
238      * 
239      * @param out
240      * @throws org.exolab.castor.xml.MarshalException if object is
241      * null or if any SAXException is thrown during marshaling
242      * @throws org.exolab.castor.xml.ValidationException if this
243      * object is an invalid instance according to the schema
244      */
245     public void marshal(
246             final java.io.Writer out)
247     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
248         Marshaller.marshal(this, out);
249     }
250
251     /**
252      * 
253      * 
254      * @param handler
255      * @throws java.io.IOException if an IOException occurs during
256      * marshaling
257      * @throws org.exolab.castor.xml.ValidationException if this
258      * object is an invalid instance according to the schema
259      * @throws org.exolab.castor.xml.MarshalException if object is
260      * null or if any SAXException is thrown during marshaling
261      */
262     public void marshal(
263             final org.xml.sax.ContentHandler handler)
264     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
265         Marshaller.marshal(this, handler);
266     }
267
268     /**
269      */
270     public void removeAllSequenceSet(
271     ) {
272         this._sequenceSetList.clear();
273     }
274
275     /**
276      */
277     public void removeAllTree(
278     ) {
279         this._treeList.clear();
280     }
281
282     /**
283      * Method removeSequenceSet.
284      * 
285      * @param vSequenceSet
286      * @return true if the object was removed from the collection.
287      */
288     public boolean removeSequenceSet(
289             final jalview.schemabinding.version2.SequenceSet vSequenceSet) {
290         boolean removed = _sequenceSetList.remove(vSequenceSet);
291         return removed;
292     }
293
294     /**
295      * Method removeSequenceSetAt.
296      * 
297      * @param index
298      * @return the element removed from the collection
299      */
300     public jalview.schemabinding.version2.SequenceSet removeSequenceSetAt(
301             final int index) {
302         java.lang.Object obj = this._sequenceSetList.remove(index);
303         return (jalview.schemabinding.version2.SequenceSet) obj;
304     }
305
306     /**
307      * Method removeTree.
308      * 
309      * @param vTree
310      * @return true if the object was removed from the collection.
311      */
312     public boolean removeTree(
313             final java.lang.String vTree) {
314         boolean removed = _treeList.remove(vTree);
315         return removed;
316     }
317
318     /**
319      * Method removeTreeAt.
320      * 
321      * @param index
322      * @return the element removed from the collection
323      */
324     public java.lang.String removeTreeAt(
325             final int index) {
326         java.lang.Object obj = this._treeList.remove(index);
327         return (java.lang.String) obj;
328     }
329
330     /**
331      * 
332      * 
333      * @param index
334      * @param vSequenceSet
335      * @throws java.lang.IndexOutOfBoundsException if the index
336      * given is outside the bounds of the collection
337      */
338     public void setSequenceSet(
339             final int index,
340             final jalview.schemabinding.version2.SequenceSet vSequenceSet)
341     throws java.lang.IndexOutOfBoundsException {
342         // check bounds for index
343         if (index < 0 || index >= this._sequenceSetList.size()) {
344             throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
345         }
346         
347         this._sequenceSetList.set(index, vSequenceSet);
348     }
349
350     /**
351      * 
352      * 
353      * @param vSequenceSetArray
354      */
355     public void setSequenceSet(
356             final jalview.schemabinding.version2.SequenceSet[] vSequenceSetArray) {
357         //-- copy array
358         _sequenceSetList.clear();
359         
360         for (int i = 0; i < vSequenceSetArray.length; i++) {
361                 this._sequenceSetList.add(vSequenceSetArray[i]);
362         }
363     }
364
365     /**
366      * 
367      * 
368      * @param index
369      * @param vTree
370      * @throws java.lang.IndexOutOfBoundsException if the index
371      * given is outside the bounds of the collection
372      */
373     public void setTree(
374             final int index,
375             final java.lang.String vTree)
376     throws java.lang.IndexOutOfBoundsException {
377         // check bounds for index
378         if (index < 0 || index >= this._treeList.size()) {
379             throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
380         }
381         
382         this._treeList.set(index, vTree);
383     }
384
385     /**
386      * 
387      * 
388      * @param vTreeArray
389      */
390     public void setTree(
391             final java.lang.String[] vTreeArray) {
392         //-- copy array
393         _treeList.clear();
394         
395         for (int i = 0; i < vTreeArray.length; i++) {
396                 this._treeList.add(vTreeArray[i]);
397         }
398     }
399
400     /**
401      * Method unmarshal.
402      * 
403      * @param reader
404      * @throws org.exolab.castor.xml.MarshalException if object is
405      * null or if any SAXException is thrown during marshaling
406      * @throws org.exolab.castor.xml.ValidationException if this
407      * object is an invalid instance according to the schema
408      * @return the unmarshaled jalview.schemabinding.version2.VAMSAS
409      */
410     public static jalview.schemabinding.version2.VAMSAS unmarshal(
411             final java.io.Reader reader)
412     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
413         return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(jalview.schemabinding.version2.VAMSAS.class, reader);
414     }
415
416     /**
417      * 
418      * 
419      * @throws org.exolab.castor.xml.ValidationException if this
420      * object is an invalid instance according to the schema
421      */
422     public void validate(
423     )
424     throws org.exolab.castor.xml.ValidationException {
425         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
426         validator.validate(this);
427     }
428
429 }