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