2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
20 * @version $Revision$ $Date$
\r
22 public class JSeq implements java.io.Serializable {
\r
25 //--------------------------/
\r
26 //- Class/Member Variables -/
\r
27 //--------------------------/
\r
32 private int _colour;
\r
35 * keeps track of state for field: _colour
\r
37 private boolean _has_colour;
\r
45 * keeps track of state for field: _start
\r
47 private boolean _has_start;
\r
55 * keeps track of state for field: _end
\r
57 private boolean _has_end;
\r
65 * keeps track of state for field: _id
\r
67 private boolean _has_id;
\r
72 private boolean _hidden;
\r
75 * keeps track of state for field: _hidden
\r
77 private boolean _has_hidden;
\r
80 * Field _featuresList.
\r
82 private java.util.Vector _featuresList;
\r
85 * Field _pdbidsList.
\r
87 private java.util.Vector _pdbidsList;
\r
90 * Field _hiddenSequencesList.
\r
92 private java.util.Vector _hiddenSequencesList;
\r
101 this._featuresList = new java.util.Vector();
\r
102 this._pdbidsList = new java.util.Vector();
\r
103 this._hiddenSequencesList = new java.util.Vector();
\r
115 * @throws java.lang.IndexOutOfBoundsException if the index
\r
116 * given is outside the bounds of the collection
\r
118 public void addFeatures(
\r
119 final jalview.schemabinding.version2.Features vFeatures)
\r
120 throws java.lang.IndexOutOfBoundsException {
\r
121 this._featuresList.addElement(vFeatures);
\r
129 * @throws java.lang.IndexOutOfBoundsException if the index
\r
130 * given is outside the bounds of the collection
\r
132 public void addFeatures(
\r
134 final jalview.schemabinding.version2.Features vFeatures)
\r
135 throws java.lang.IndexOutOfBoundsException {
\r
136 this._featuresList.add(index, vFeatures);
\r
142 * @param vHiddenSequences
\r
143 * @throws java.lang.IndexOutOfBoundsException if the index
\r
144 * given is outside the bounds of the collection
\r
146 public void addHiddenSequences(
\r
147 final int vHiddenSequences)
\r
148 throws java.lang.IndexOutOfBoundsException {
\r
149 this._hiddenSequencesList.addElement(new java.lang.Integer(vHiddenSequences));
\r
156 * @param vHiddenSequences
\r
157 * @throws java.lang.IndexOutOfBoundsException if the index
\r
158 * given is outside the bounds of the collection
\r
160 public void addHiddenSequences(
\r
162 final int vHiddenSequences)
\r
163 throws java.lang.IndexOutOfBoundsException {
\r
164 this._hiddenSequencesList.add(index, new java.lang.Integer(vHiddenSequences));
\r
171 * @throws java.lang.IndexOutOfBoundsException if the index
\r
172 * given is outside the bounds of the collection
\r
174 public void addPdbids(
\r
175 final jalview.schemabinding.version2.Pdbids vPdbids)
\r
176 throws java.lang.IndexOutOfBoundsException {
\r
177 this._pdbidsList.addElement(vPdbids);
\r
185 * @throws java.lang.IndexOutOfBoundsException if the index
\r
186 * given is outside the bounds of the collection
\r
188 public void addPdbids(
\r
190 final jalview.schemabinding.version2.Pdbids vPdbids)
\r
191 throws java.lang.IndexOutOfBoundsException {
\r
192 this._pdbidsList.add(index, vPdbids);
\r
197 public void deleteColour(
\r
199 this._has_colour= false;
\r
204 public void deleteEnd(
\r
206 this._has_end= false;
\r
211 public void deleteHidden(
\r
213 this._has_hidden= false;
\r
218 public void deleteId(
\r
220 this._has_id= false;
\r
225 public void deleteStart(
\r
227 this._has_start= false;
\r
231 * Method enumerateFeatures.
\r
233 * @return an Enumeration over all
\r
234 * jalview.schemabinding.version2.Features elements
\r
236 public java.util.Enumeration enumerateFeatures(
\r
238 return this._featuresList.elements();
\r
242 * Method enumerateHiddenSequences.
\r
244 * @return an Enumeration over all int elements
\r
246 public java.util.Enumeration enumerateHiddenSequences(
\r
248 return this._hiddenSequencesList.elements();
\r
252 * Method enumeratePdbids.
\r
254 * @return an Enumeration over all
\r
255 * jalview.schemabinding.version2.Pdbids elements
\r
257 public java.util.Enumeration enumeratePdbids(
\r
259 return this._pdbidsList.elements();
\r
263 * Returns the value of field 'colour'.
\r
265 * @return the value of field 'Colour'.
\r
267 public int getColour(
\r
269 return this._colour;
\r
273 * Returns the value of field 'end'.
\r
275 * @return the value of field 'End'.
\r
283 * Method getFeatures.
\r
286 * @throws java.lang.IndexOutOfBoundsException if the index
\r
287 * given is outside the bounds of the collection
\r
288 * @return the value of the
\r
289 * jalview.schemabinding.version2.Features at the given index
\r
291 public jalview.schemabinding.version2.Features getFeatures(
\r
293 throws java.lang.IndexOutOfBoundsException {
\r
294 // check bounds for index
\r
295 if (index < 0 || index >= this._featuresList.size()) {
\r
296 throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
\r
299 return (jalview.schemabinding.version2.Features) _featuresList.get(index);
\r
303 * Method getFeatures.Returns the contents of the collection in
\r
304 * an Array. <p>Note: Just in case the collection contents
\r
305 * are changing in another thread, we pass a 0-length Array of
\r
306 * the correct type into the API call. This way we <i>know</i>
\r
307 * that the Array returned is of exactly the correct length.
\r
309 * @return this collection as an Array
\r
311 public jalview.schemabinding.version2.Features[] getFeatures(
\r
313 jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
\r
314 return (jalview.schemabinding.version2.Features[]) this._featuresList.toArray(array);
\r
318 * Method getFeaturesCount.
\r
320 * @return the size of this collection
\r
322 public int getFeaturesCount(
\r
324 return this._featuresList.size();
\r
328 * Returns the value of field 'hidden'.
\r
330 * @return the value of field 'Hidden'.
\r
332 public boolean getHidden(
\r
334 return this._hidden;
\r
338 * Method getHiddenSequences.
\r
341 * @throws java.lang.IndexOutOfBoundsException if the index
\r
342 * given is outside the bounds of the collection
\r
343 * @return the value of the int at the given index
\r
345 public int getHiddenSequences(
\r
347 throws java.lang.IndexOutOfBoundsException {
\r
348 // check bounds for index
\r
349 if (index < 0 || index >= this._hiddenSequencesList.size()) {
\r
350 throw new IndexOutOfBoundsException("getHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
\r
353 return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
\r
357 * Method getHiddenSequences.Returns the contents of the
\r
358 * collection in an Array.
\r
360 * @return this collection as an Array
\r
362 public int[] getHiddenSequences(
\r
364 int size = this._hiddenSequencesList.size();
\r
365 int[] array = new int[size];
\r
366 java.util.Iterator iter = _hiddenSequencesList.iterator();
\r
367 for (int index = 0; index < size; index++) {
\r
368 array[index] = ((java.lang.Integer) iter.next()).intValue();
\r
374 * Method getHiddenSequencesCount.
\r
376 * @return the size of this collection
\r
378 public int getHiddenSequencesCount(
\r
380 return this._hiddenSequencesList.size();
\r
384 * Returns the value of field 'id'.
\r
386 * @return the value of field 'Id'.
\r
394 * Method getPdbids.
\r
397 * @throws java.lang.IndexOutOfBoundsException if the index
\r
398 * given is outside the bounds of the collection
\r
399 * @return the value of the
\r
400 * jalview.schemabinding.version2.Pdbids at the given index
\r
402 public jalview.schemabinding.version2.Pdbids getPdbids(
\r
404 throws java.lang.IndexOutOfBoundsException {
\r
405 // check bounds for index
\r
406 if (index < 0 || index >= this._pdbidsList.size()) {
\r
407 throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
\r
410 return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
\r
414 * Method getPdbids.Returns the contents of the collection in
\r
415 * an Array. <p>Note: Just in case the collection contents
\r
416 * are changing in another thread, we pass a 0-length Array of
\r
417 * the correct type into the API call. This way we <i>know</i>
\r
418 * that the Array returned is of exactly the correct length.
\r
420 * @return this collection as an Array
\r
422 public jalview.schemabinding.version2.Pdbids[] getPdbids(
\r
424 jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
\r
425 return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList.toArray(array);
\r
429 * Method getPdbidsCount.
\r
431 * @return the size of this collection
\r
433 public int getPdbidsCount(
\r
435 return this._pdbidsList.size();
\r
439 * Returns the value of field 'start'.
\r
441 * @return the value of field 'Start'.
\r
443 public int getStart(
\r
445 return this._start;
\r
449 * Method hasColour.
\r
451 * @return true if at least one Colour has been added
\r
453 public boolean hasColour(
\r
455 return this._has_colour;
\r
461 * @return true if at least one End has been added
\r
463 public boolean hasEnd(
\r
465 return this._has_end;
\r
469 * Method hasHidden.
\r
471 * @return true if at least one Hidden has been added
\r
473 public boolean hasHidden(
\r
475 return this._has_hidden;
\r
481 * @return true if at least one Id has been added
\r
483 public boolean hasId(
\r
485 return this._has_id;
\r
491 * @return true if at least one Start has been added
\r
493 public boolean hasStart(
\r
495 return this._has_start;
\r
499 * Returns the value of field 'hidden'.
\r
501 * @return the value of field 'Hidden'.
\r
503 public boolean isHidden(
\r
505 return this._hidden;
\r
511 * @return true if this object is valid according to the schema
\r
513 public boolean isValid(
\r
517 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
527 * @throws org.exolab.castor.xml.MarshalException if object is
\r
528 * null or if any SAXException is thrown during marshaling
\r
529 * @throws org.exolab.castor.xml.ValidationException if this
\r
530 * object is an invalid instance according to the schema
\r
532 public void marshal(
\r
533 final java.io.Writer out)
\r
534 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
535 Marshaller.marshal(this, out);
\r
542 * @throws java.io.IOException if an IOException occurs during
\r
544 * @throws org.exolab.castor.xml.ValidationException if this
\r
545 * object is an invalid instance according to the schema
\r
546 * @throws org.exolab.castor.xml.MarshalException if object is
\r
547 * null or if any SAXException is thrown during marshaling
\r
549 public void marshal(
\r
550 final org.xml.sax.ContentHandler handler)
\r
551 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
552 Marshaller.marshal(this, handler);
\r
557 public void removeAllFeatures(
\r
559 this._featuresList.clear();
\r
564 public void removeAllHiddenSequences(
\r
566 this._hiddenSequencesList.clear();
\r
571 public void removeAllPdbids(
\r
573 this._pdbidsList.clear();
\r
577 * Method removeFeatures.
\r
580 * @return true if the object was removed from the collection.
\r
582 public boolean removeFeatures(
\r
583 final jalview.schemabinding.version2.Features vFeatures) {
\r
584 boolean removed = _featuresList.remove(vFeatures);
\r
589 * Method removeFeaturesAt.
\r
592 * @return the element removed from the collection
\r
594 public jalview.schemabinding.version2.Features removeFeaturesAt(
\r
596 java.lang.Object obj = this._featuresList.remove(index);
\r
597 return (jalview.schemabinding.version2.Features) obj;
\r
601 * Method removeHiddenSequences.
\r
603 * @param vHiddenSequences
\r
604 * @return true if the object was removed from the collection.
\r
606 public boolean removeHiddenSequences(
\r
607 final int vHiddenSequences) {
\r
608 boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(vHiddenSequences));
\r
613 * Method removeHiddenSequencesAt.
\r
616 * @return the element removed from the collection
\r
618 public int removeHiddenSequencesAt(
\r
620 java.lang.Object obj = this._hiddenSequencesList.remove(index);
\r
621 return ((java.lang.Integer) obj).intValue();
\r
625 * Method removePdbids.
\r
628 * @return true if the object was removed from the collection.
\r
630 public boolean removePdbids(
\r
631 final jalview.schemabinding.version2.Pdbids vPdbids) {
\r
632 boolean removed = _pdbidsList.remove(vPdbids);
\r
637 * Method removePdbidsAt.
\r
640 * @return the element removed from the collection
\r
642 public jalview.schemabinding.version2.Pdbids removePdbidsAt(
\r
644 java.lang.Object obj = this._pdbidsList.remove(index);
\r
645 return (jalview.schemabinding.version2.Pdbids) obj;
\r
649 * Sets the value of field 'colour'.
\r
651 * @param colour the value of field 'colour'.
\r
653 public void setColour(
\r
654 final int colour) {
\r
655 this._colour = colour;
\r
656 this._has_colour = true;
\r
660 * Sets the value of field 'end'.
\r
662 * @param end the value of field 'end'.
\r
664 public void setEnd(
\r
667 this._has_end = true;
\r
675 * @throws java.lang.IndexOutOfBoundsException if the index
\r
676 * given is outside the bounds of the collection
\r
678 public void setFeatures(
\r
680 final jalview.schemabinding.version2.Features vFeatures)
\r
681 throws java.lang.IndexOutOfBoundsException {
\r
682 // check bounds for index
\r
683 if (index < 0 || index >= this._featuresList.size()) {
\r
684 throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
\r
687 this._featuresList.set(index, vFeatures);
\r
693 * @param vFeaturesArray
\r
695 public void setFeatures(
\r
696 final jalview.schemabinding.version2.Features[] vFeaturesArray) {
\r
698 _featuresList.clear();
\r
700 for (int i = 0; i < vFeaturesArray.length; i++) {
\r
701 this._featuresList.add(vFeaturesArray[i]);
\r
706 * Sets the value of field 'hidden'.
\r
708 * @param hidden the value of field 'hidden'.
\r
710 public void setHidden(
\r
711 final boolean hidden) {
\r
712 this._hidden = hidden;
\r
713 this._has_hidden = true;
\r
720 * @param vHiddenSequences
\r
721 * @throws java.lang.IndexOutOfBoundsException if the index
\r
722 * given is outside the bounds of the collection
\r
724 public void setHiddenSequences(
\r
726 final int vHiddenSequences)
\r
727 throws java.lang.IndexOutOfBoundsException {
\r
728 // check bounds for index
\r
729 if (index < 0 || index >= this._hiddenSequencesList.size()) {
\r
730 throw new IndexOutOfBoundsException("setHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
\r
733 this._hiddenSequencesList.set(index, new java.lang.Integer(vHiddenSequences));
\r
739 * @param vHiddenSequencesArray
\r
741 public void setHiddenSequences(
\r
742 final int[] vHiddenSequencesArray) {
\r
744 _hiddenSequencesList.clear();
\r
746 for (int i = 0; i < vHiddenSequencesArray.length; i++) {
\r
747 this._hiddenSequencesList.add(new java.lang.Integer(vHiddenSequencesArray[i]));
\r
752 * Sets the value of field 'id'.
\r
754 * @param id the value of field 'id'.
\r
759 this._has_id = true;
\r
767 * @throws java.lang.IndexOutOfBoundsException if the index
\r
768 * given is outside the bounds of the collection
\r
770 public void setPdbids(
\r
772 final jalview.schemabinding.version2.Pdbids vPdbids)
\r
773 throws java.lang.IndexOutOfBoundsException {
\r
774 // check bounds for index
\r
775 if (index < 0 || index >= this._pdbidsList.size()) {
\r
776 throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
\r
779 this._pdbidsList.set(index, vPdbids);
\r
785 * @param vPdbidsArray
\r
787 public void setPdbids(
\r
788 final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) {
\r
790 _pdbidsList.clear();
\r
792 for (int i = 0; i < vPdbidsArray.length; i++) {
\r
793 this._pdbidsList.add(vPdbidsArray[i]);
\r
798 * Sets the value of field 'start'.
\r
800 * @param start the value of field 'start'.
\r
802 public void setStart(
\r
804 this._start = start;
\r
805 this._has_start = true;
\r
809 * Method unmarshal.
\r
812 * @throws org.exolab.castor.xml.MarshalException if object is
\r
813 * null or if any SAXException is thrown during marshaling
\r
814 * @throws org.exolab.castor.xml.ValidationException if this
\r
815 * object is an invalid instance according to the schema
\r
816 * @return the unmarshaled jalview.schemabinding.version2.JSeq
\r
818 public static jalview.schemabinding.version2.JSeq unmarshal(
\r
819 final java.io.Reader reader)
\r
820 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
821 return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(jalview.schemabinding.version2.JSeq.class, reader);
\r
827 * @throws org.exolab.castor.xml.ValidationException if this
\r
828 * object is an invalid instance according to the schema
\r
830 public void validate(
\r
832 throws org.exolab.castor.xml.ValidationException {
\r
833 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
834 validator.validate(this);
\r