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