d5eda077cc67eac934c73014040230724bf4a830
[jalview.git] / src / jalview / schemabinding / version2 / JSeq.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 JSeq.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class JSeq implements java.io.Serializable {
23
24
25       //--------------------------/
26      //- Class/Member Variables -/
27     //--------------------------/
28
29     /**
30      * Field _colour.
31      */
32     private int _colour;
33
34     /**
35      * keeps track of state for field: _colour
36      */
37     private boolean _has_colour;
38
39     /**
40      * Field _start.
41      */
42     private int _start;
43
44     /**
45      * keeps track of state for field: _start
46      */
47     private boolean _has_start;
48
49     /**
50      * Field _end.
51      */
52     private int _end;
53
54     /**
55      * keeps track of state for field: _end
56      */
57     private boolean _has_end;
58
59     /**
60      * Field _id.
61      */
62     private java.lang.String _id;
63
64     /**
65      * Field _hidden.
66      */
67     private boolean _hidden;
68
69     /**
70      * keeps track of state for field: _hidden
71      */
72     private boolean _has_hidden;
73
74     /**
75      * Field _featuresList.
76      */
77     private java.util.Vector _featuresList;
78
79     /**
80      * Field _pdbidsList.
81      */
82     private java.util.Vector _pdbidsList;
83
84     /**
85      * Field _hiddenSequencesList.
86      */
87     private java.util.Vector _hiddenSequencesList;
88
89
90       //----------------/
91      //- Constructors -/
92     //----------------/
93
94     public JSeq() {
95         super();
96         this._featuresList = new java.util.Vector();
97         this._pdbidsList = new java.util.Vector();
98         this._hiddenSequencesList = new java.util.Vector();
99     }
100
101
102       //-----------/
103      //- Methods -/
104     //-----------/
105
106     /**
107      * 
108      * 
109      * @param vFeatures
110      * @throws java.lang.IndexOutOfBoundsException if the index
111      * given is outside the bounds of the collection
112      */
113     public void addFeatures(
114             final jalview.schemabinding.version2.Features vFeatures)
115     throws java.lang.IndexOutOfBoundsException {
116         this._featuresList.addElement(vFeatures);
117     }
118
119     /**
120      * 
121      * 
122      * @param index
123      * @param vFeatures
124      * @throws java.lang.IndexOutOfBoundsException if the index
125      * given is outside the bounds of the collection
126      */
127     public void addFeatures(
128             final int index,
129             final jalview.schemabinding.version2.Features vFeatures)
130     throws java.lang.IndexOutOfBoundsException {
131         this._featuresList.add(index, vFeatures);
132     }
133
134     /**
135      * 
136      * 
137      * @param vHiddenSequences
138      * @throws java.lang.IndexOutOfBoundsException if the index
139      * given is outside the bounds of the collection
140      */
141     public void addHiddenSequences(
142             final int vHiddenSequences)
143     throws java.lang.IndexOutOfBoundsException {
144         this._hiddenSequencesList.addElement(new java.lang.Integer(vHiddenSequences));
145     }
146
147     /**
148      * 
149      * 
150      * @param index
151      * @param vHiddenSequences
152      * @throws java.lang.IndexOutOfBoundsException if the index
153      * given is outside the bounds of the collection
154      */
155     public void addHiddenSequences(
156             final int index,
157             final int vHiddenSequences)
158     throws java.lang.IndexOutOfBoundsException {
159         this._hiddenSequencesList.add(index, new java.lang.Integer(vHiddenSequences));
160     }
161
162     /**
163      * 
164      * 
165      * @param vPdbids
166      * @throws java.lang.IndexOutOfBoundsException if the index
167      * given is outside the bounds of the collection
168      */
169     public void addPdbids(
170             final jalview.schemabinding.version2.Pdbids vPdbids)
171     throws java.lang.IndexOutOfBoundsException {
172         this._pdbidsList.addElement(vPdbids);
173     }
174
175     /**
176      * 
177      * 
178      * @param index
179      * @param vPdbids
180      * @throws java.lang.IndexOutOfBoundsException if the index
181      * given is outside the bounds of the collection
182      */
183     public void addPdbids(
184             final int index,
185             final jalview.schemabinding.version2.Pdbids vPdbids)
186     throws java.lang.IndexOutOfBoundsException {
187         this._pdbidsList.add(index, vPdbids);
188     }
189
190     /**
191      */
192     public void deleteColour(
193     ) {
194         this._has_colour= false;
195     }
196
197     /**
198      */
199     public void deleteEnd(
200     ) {
201         this._has_end= false;
202     }
203
204     /**
205      */
206     public void deleteHidden(
207     ) {
208         this._has_hidden= false;
209     }
210
211     /**
212      */
213     public void deleteStart(
214     ) {
215         this._has_start= false;
216     }
217
218     /**
219      * Method enumerateFeatures.
220      * 
221      * @return an Enumeration over all
222      * jalview.schemabinding.version2.Features elements
223      */
224     public java.util.Enumeration enumerateFeatures(
225     ) {
226         return this._featuresList.elements();
227     }
228
229     /**
230      * Method enumerateHiddenSequences.
231      * 
232      * @return an Enumeration over all int elements
233      */
234     public java.util.Enumeration enumerateHiddenSequences(
235     ) {
236         return this._hiddenSequencesList.elements();
237     }
238
239     /**
240      * Method enumeratePdbids.
241      * 
242      * @return an Enumeration over all
243      * jalview.schemabinding.version2.Pdbids elements
244      */
245     public java.util.Enumeration enumeratePdbids(
246     ) {
247         return this._pdbidsList.elements();
248     }
249
250     /**
251      * Returns the value of field 'colour'.
252      * 
253      * @return the value of field 'Colour'.
254      */
255     public int getColour(
256     ) {
257         return this._colour;
258     }
259
260     /**
261      * Returns the value of field 'end'.
262      * 
263      * @return the value of field 'End'.
264      */
265     public int getEnd(
266     ) {
267         return this._end;
268     }
269
270     /**
271      * Method getFeatures.
272      * 
273      * @param index
274      * @throws java.lang.IndexOutOfBoundsException if the index
275      * given is outside the bounds of the collection
276      * @return the value of the
277      * jalview.schemabinding.version2.Features at the given index
278      */
279     public jalview.schemabinding.version2.Features getFeatures(
280             final int index)
281     throws java.lang.IndexOutOfBoundsException {
282         // check bounds for index
283         if (index < 0 || index >= this._featuresList.size()) {
284             throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
285         }
286         
287         return (jalview.schemabinding.version2.Features) _featuresList.get(index);
288     }
289
290     /**
291      * Method getFeatures.Returns the contents of the collection in
292      * an Array.  <p>Note:  Just in case the collection contents
293      * are changing in another thread, we pass a 0-length Array of
294      * the correct type into the API call.  This way we <i>know</i>
295      * that the Array returned is of exactly the correct length.
296      * 
297      * @return this collection as an Array
298      */
299     public jalview.schemabinding.version2.Features[] getFeatures(
300     ) {
301         jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
302         return (jalview.schemabinding.version2.Features[]) this._featuresList.toArray(array);
303     }
304
305     /**
306      * Method getFeaturesCount.
307      * 
308      * @return the size of this collection
309      */
310     public int getFeaturesCount(
311     ) {
312         return this._featuresList.size();
313     }
314
315     /**
316      * Returns the value of field 'hidden'.
317      * 
318      * @return the value of field 'Hidden'.
319      */
320     public boolean getHidden(
321     ) {
322         return this._hidden;
323     }
324
325     /**
326      * Method getHiddenSequences.
327      * 
328      * @param index
329      * @throws java.lang.IndexOutOfBoundsException if the index
330      * given is outside the bounds of the collection
331      * @return the value of the int at the given index
332      */
333     public int getHiddenSequences(
334             final int index)
335     throws java.lang.IndexOutOfBoundsException {
336         // check bounds for index
337         if (index < 0 || index >= this._hiddenSequencesList.size()) {
338             throw new IndexOutOfBoundsException("getHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
339         }
340         
341         return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
342     }
343
344     /**
345      * Method getHiddenSequences.Returns the contents of the
346      * collection in an Array.  
347      * 
348      * @return this collection as an Array
349      */
350     public int[] getHiddenSequences(
351     ) {
352         int size = this._hiddenSequencesList.size();
353         int[] array = new int[size];
354         java.util.Iterator iter = _hiddenSequencesList.iterator();
355         for (int index = 0; index < size; index++) {
356             array[index] = ((java.lang.Integer) iter.next()).intValue();
357         }
358         return array;
359     }
360
361     /**
362      * Method getHiddenSequencesCount.
363      * 
364      * @return the size of this collection
365      */
366     public int getHiddenSequencesCount(
367     ) {
368         return this._hiddenSequencesList.size();
369     }
370
371     /**
372      * Returns the value of field 'id'.
373      * 
374      * @return the value of field 'Id'.
375      */
376     public java.lang.String getId(
377     ) {
378         return this._id;
379     }
380
381     /**
382      * Method getPdbids.
383      * 
384      * @param index
385      * @throws java.lang.IndexOutOfBoundsException if the index
386      * given is outside the bounds of the collection
387      * @return the value of the
388      * jalview.schemabinding.version2.Pdbids at the given index
389      */
390     public jalview.schemabinding.version2.Pdbids getPdbids(
391             final int index)
392     throws java.lang.IndexOutOfBoundsException {
393         // check bounds for index
394         if (index < 0 || index >= this._pdbidsList.size()) {
395             throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
396         }
397         
398         return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
399     }
400
401     /**
402      * Method getPdbids.Returns the contents of the collection in
403      * an Array.  <p>Note:  Just in case the collection contents
404      * are changing in another thread, we pass a 0-length Array of
405      * the correct type into the API call.  This way we <i>know</i>
406      * that the Array returned is of exactly the correct length.
407      * 
408      * @return this collection as an Array
409      */
410     public jalview.schemabinding.version2.Pdbids[] getPdbids(
411     ) {
412         jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
413         return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList.toArray(array);
414     }
415
416     /**
417      * Method getPdbidsCount.
418      * 
419      * @return the size of this collection
420      */
421     public int getPdbidsCount(
422     ) {
423         return this._pdbidsList.size();
424     }
425
426     /**
427      * Returns the value of field 'start'.
428      * 
429      * @return the value of field 'Start'.
430      */
431     public int getStart(
432     ) {
433         return this._start;
434     }
435
436     /**
437      * Method hasColour.
438      * 
439      * @return true if at least one Colour has been added
440      */
441     public boolean hasColour(
442     ) {
443         return this._has_colour;
444     }
445
446     /**
447      * Method hasEnd.
448      * 
449      * @return true if at least one End has been added
450      */
451     public boolean hasEnd(
452     ) {
453         return this._has_end;
454     }
455
456     /**
457      * Method hasHidden.
458      * 
459      * @return true if at least one Hidden has been added
460      */
461     public boolean hasHidden(
462     ) {
463         return this._has_hidden;
464     }
465
466     /**
467      * Method hasStart.
468      * 
469      * @return true if at least one Start has been added
470      */
471     public boolean hasStart(
472     ) {
473         return this._has_start;
474     }
475
476     /**
477      * Returns the value of field 'hidden'.
478      * 
479      * @return the value of field 'Hidden'.
480      */
481     public boolean isHidden(
482     ) {
483         return this._hidden;
484     }
485
486     /**
487      * Method isValid.
488      * 
489      * @return true if this object is valid according to the schema
490      */
491     public boolean isValid(
492     ) {
493         try {
494             validate();
495         } catch (org.exolab.castor.xml.ValidationException vex) {
496             return false;
497         }
498         return true;
499     }
500
501     /**
502      * 
503      * 
504      * @param out
505      * @throws org.exolab.castor.xml.MarshalException if object is
506      * null or if any SAXException is thrown during marshaling
507      * @throws org.exolab.castor.xml.ValidationException if this
508      * object is an invalid instance according to the schema
509      */
510     public void marshal(
511             final java.io.Writer out)
512     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
513         Marshaller.marshal(this, out);
514     }
515
516     /**
517      * 
518      * 
519      * @param handler
520      * @throws java.io.IOException if an IOException occurs during
521      * marshaling
522      * @throws org.exolab.castor.xml.ValidationException if this
523      * object is an invalid instance according to the schema
524      * @throws org.exolab.castor.xml.MarshalException if object is
525      * null or if any SAXException is thrown during marshaling
526      */
527     public void marshal(
528             final org.xml.sax.ContentHandler handler)
529     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
530         Marshaller.marshal(this, handler);
531     }
532
533     /**
534      */
535     public void removeAllFeatures(
536     ) {
537         this._featuresList.clear();
538     }
539
540     /**
541      */
542     public void removeAllHiddenSequences(
543     ) {
544         this._hiddenSequencesList.clear();
545     }
546
547     /**
548      */
549     public void removeAllPdbids(
550     ) {
551         this._pdbidsList.clear();
552     }
553
554     /**
555      * Method removeFeatures.
556      * 
557      * @param vFeatures
558      * @return true if the object was removed from the collection.
559      */
560     public boolean removeFeatures(
561             final jalview.schemabinding.version2.Features vFeatures) {
562         boolean removed = _featuresList.remove(vFeatures);
563         return removed;
564     }
565
566     /**
567      * Method removeFeaturesAt.
568      * 
569      * @param index
570      * @return the element removed from the collection
571      */
572     public jalview.schemabinding.version2.Features removeFeaturesAt(
573             final int index) {
574         java.lang.Object obj = this._featuresList.remove(index);
575         return (jalview.schemabinding.version2.Features) obj;
576     }
577
578     /**
579      * Method removeHiddenSequences.
580      * 
581      * @param vHiddenSequences
582      * @return true if the object was removed from the collection.
583      */
584     public boolean removeHiddenSequences(
585             final int vHiddenSequences) {
586         boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(vHiddenSequences));
587         return removed;
588     }
589
590     /**
591      * Method removeHiddenSequencesAt.
592      * 
593      * @param index
594      * @return the element removed from the collection
595      */
596     public int removeHiddenSequencesAt(
597             final int index) {
598         java.lang.Object obj = this._hiddenSequencesList.remove(index);
599         return ((java.lang.Integer) obj).intValue();
600     }
601
602     /**
603      * Method removePdbids.
604      * 
605      * @param vPdbids
606      * @return true if the object was removed from the collection.
607      */
608     public boolean removePdbids(
609             final jalview.schemabinding.version2.Pdbids vPdbids) {
610         boolean removed = _pdbidsList.remove(vPdbids);
611         return removed;
612     }
613
614     /**
615      * Method removePdbidsAt.
616      * 
617      * @param index
618      * @return the element removed from the collection
619      */
620     public jalview.schemabinding.version2.Pdbids removePdbidsAt(
621             final int index) {
622         java.lang.Object obj = this._pdbidsList.remove(index);
623         return (jalview.schemabinding.version2.Pdbids) obj;
624     }
625
626     /**
627      * Sets the value of field 'colour'.
628      * 
629      * @param colour the value of field 'colour'.
630      */
631     public void setColour(
632             final int colour) {
633         this._colour = colour;
634         this._has_colour = true;
635     }
636
637     /**
638      * Sets the value of field 'end'.
639      * 
640      * @param end the value of field 'end'.
641      */
642     public void setEnd(
643             final int end) {
644         this._end = end;
645         this._has_end = true;
646     }
647
648     /**
649      * 
650      * 
651      * @param index
652      * @param vFeatures
653      * @throws java.lang.IndexOutOfBoundsException if the index
654      * given is outside the bounds of the collection
655      */
656     public void setFeatures(
657             final int index,
658             final jalview.schemabinding.version2.Features vFeatures)
659     throws java.lang.IndexOutOfBoundsException {
660         // check bounds for index
661         if (index < 0 || index >= this._featuresList.size()) {
662             throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
663         }
664         
665         this._featuresList.set(index, vFeatures);
666     }
667
668     /**
669      * 
670      * 
671      * @param vFeaturesArray
672      */
673     public void setFeatures(
674             final jalview.schemabinding.version2.Features[] vFeaturesArray) {
675         //-- copy array
676         _featuresList.clear();
677         
678         for (int i = 0; i < vFeaturesArray.length; i++) {
679                 this._featuresList.add(vFeaturesArray[i]);
680         }
681     }
682
683     /**
684      * Sets the value of field 'hidden'.
685      * 
686      * @param hidden the value of field 'hidden'.
687      */
688     public void setHidden(
689             final boolean hidden) {
690         this._hidden = hidden;
691         this._has_hidden = true;
692     }
693
694     /**
695      * 
696      * 
697      * @param index
698      * @param vHiddenSequences
699      * @throws java.lang.IndexOutOfBoundsException if the index
700      * given is outside the bounds of the collection
701      */
702     public void setHiddenSequences(
703             final int index,
704             final int vHiddenSequences)
705     throws java.lang.IndexOutOfBoundsException {
706         // check bounds for index
707         if (index < 0 || index >= this._hiddenSequencesList.size()) {
708             throw new IndexOutOfBoundsException("setHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
709         }
710         
711         this._hiddenSequencesList.set(index, new java.lang.Integer(vHiddenSequences));
712     }
713
714     /**
715      * 
716      * 
717      * @param vHiddenSequencesArray
718      */
719     public void setHiddenSequences(
720             final int[] vHiddenSequencesArray) {
721         //-- copy array
722         _hiddenSequencesList.clear();
723         
724         for (int i = 0; i < vHiddenSequencesArray.length; i++) {
725                 this._hiddenSequencesList.add(new java.lang.Integer(vHiddenSequencesArray[i]));
726         }
727     }
728
729     /**
730      * Sets the value of field 'id'.
731      * 
732      * @param id the value of field 'id'.
733      */
734     public void setId(
735             final java.lang.String id) {
736         this._id = id;
737     }
738
739     /**
740      * 
741      * 
742      * @param index
743      * @param vPdbids
744      * @throws java.lang.IndexOutOfBoundsException if the index
745      * given is outside the bounds of the collection
746      */
747     public void setPdbids(
748             final int index,
749             final jalview.schemabinding.version2.Pdbids vPdbids)
750     throws java.lang.IndexOutOfBoundsException {
751         // check bounds for index
752         if (index < 0 || index >= this._pdbidsList.size()) {
753             throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
754         }
755         
756         this._pdbidsList.set(index, vPdbids);
757     }
758
759     /**
760      * 
761      * 
762      * @param vPdbidsArray
763      */
764     public void setPdbids(
765             final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) {
766         //-- copy array
767         _pdbidsList.clear();
768         
769         for (int i = 0; i < vPdbidsArray.length; i++) {
770                 this._pdbidsList.add(vPdbidsArray[i]);
771         }
772     }
773
774     /**
775      * Sets the value of field 'start'.
776      * 
777      * @param start the value of field 'start'.
778      */
779     public void setStart(
780             final int start) {
781         this._start = start;
782         this._has_start = true;
783     }
784
785     /**
786      * Method unmarshal.
787      * 
788      * @param reader
789      * @throws org.exolab.castor.xml.MarshalException if object is
790      * null or if any SAXException is thrown during marshaling
791      * @throws org.exolab.castor.xml.ValidationException if this
792      * object is an invalid instance according to the schema
793      * @return the unmarshaled jalview.schemabinding.version2.JSeq
794      */
795     public static jalview.schemabinding.version2.JSeq unmarshal(
796             final java.io.Reader reader)
797     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
798         return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(jalview.schemabinding.version2.JSeq.class, reader);
799     }
800
801     /**
802      * 
803      * 
804      * @throws org.exolab.castor.xml.ValidationException if this
805      * object is an invalid instance according to the schema
806      */
807     public void validate(
808     )
809     throws org.exolab.castor.xml.ValidationException {
810         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
811         validator.validate(this);
812     }
813
814 }