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
62 private java.lang.String _id;
\r
67 private boolean _hidden;
\r
70 * keeps track of state for field: _hidden
\r
72 private boolean _has_hidden;
\r
75 * Field _featuresList.
\r
77 private java.util.Vector _featuresList;
\r
80 * Field _pdbidsList.
\r
82 private java.util.Vector _pdbidsList;
\r
85 * Field _hiddenSequencesList.
\r
87 private java.util.Vector _hiddenSequencesList;
\r
96 this._featuresList = new java.util.Vector();
\r
97 this._pdbidsList = new java.util.Vector();
\r
98 this._hiddenSequencesList = new java.util.Vector();
\r
110 * @throws java.lang.IndexOutOfBoundsException if the index
\r
111 * given is outside the bounds of the collection
\r
113 public void addFeatures(
\r
114 final jalview.schemabinding.version2.Features vFeatures)
\r
115 throws java.lang.IndexOutOfBoundsException {
\r
116 this._featuresList.addElement(vFeatures);
\r
124 * @throws java.lang.IndexOutOfBoundsException if the index
\r
125 * given is outside the bounds of the collection
\r
127 public void addFeatures(
\r
129 final jalview.schemabinding.version2.Features vFeatures)
\r
130 throws java.lang.IndexOutOfBoundsException {
\r
131 this._featuresList.add(index, vFeatures);
\r
137 * @param vHiddenSequences
\r
138 * @throws java.lang.IndexOutOfBoundsException if the index
\r
139 * given is outside the bounds of the collection
\r
141 public void addHiddenSequences(
\r
142 final int vHiddenSequences)
\r
143 throws java.lang.IndexOutOfBoundsException {
\r
144 this._hiddenSequencesList.addElement(new java.lang.Integer(vHiddenSequences));
\r
151 * @param vHiddenSequences
\r
152 * @throws java.lang.IndexOutOfBoundsException if the index
\r
153 * given is outside the bounds of the collection
\r
155 public void addHiddenSequences(
\r
157 final int vHiddenSequences)
\r
158 throws java.lang.IndexOutOfBoundsException {
\r
159 this._hiddenSequencesList.add(index, new java.lang.Integer(vHiddenSequences));
\r
166 * @throws java.lang.IndexOutOfBoundsException if the index
\r
167 * given is outside the bounds of the collection
\r
169 public void addPdbids(
\r
170 final jalview.schemabinding.version2.Pdbids vPdbids)
\r
171 throws java.lang.IndexOutOfBoundsException {
\r
172 this._pdbidsList.addElement(vPdbids);
\r
180 * @throws java.lang.IndexOutOfBoundsException if the index
\r
181 * given is outside the bounds of the collection
\r
183 public void addPdbids(
\r
185 final jalview.schemabinding.version2.Pdbids vPdbids)
\r
186 throws java.lang.IndexOutOfBoundsException {
\r
187 this._pdbidsList.add(index, vPdbids);
\r
192 public void deleteColour(
\r
194 this._has_colour= false;
\r
199 public void deleteEnd(
\r
201 this._has_end= false;
\r
206 public void deleteHidden(
\r
208 this._has_hidden= false;
\r
213 public void deleteStart(
\r
215 this._has_start= false;
\r
219 * Method enumerateFeatures.
\r
221 * @return an Enumeration over all
\r
222 * jalview.schemabinding.version2.Features elements
\r
224 public java.util.Enumeration enumerateFeatures(
\r
226 return this._featuresList.elements();
\r
230 * Method enumerateHiddenSequences.
\r
232 * @return an Enumeration over all int elements
\r
234 public java.util.Enumeration enumerateHiddenSequences(
\r
236 return this._hiddenSequencesList.elements();
\r
240 * Method enumeratePdbids.
\r
242 * @return an Enumeration over all
\r
243 * jalview.schemabinding.version2.Pdbids elements
\r
245 public java.util.Enumeration enumeratePdbids(
\r
247 return this._pdbidsList.elements();
\r
251 * Returns the value of field 'colour'.
\r
253 * @return the value of field 'Colour'.
\r
255 public int getColour(
\r
257 return this._colour;
\r
261 * Returns the value of field 'end'.
\r
263 * @return the value of field 'End'.
\r
271 * Method getFeatures.
\r
274 * @throws java.lang.IndexOutOfBoundsException if the index
\r
275 * given is outside the bounds of the collection
\r
276 * @return the value of the
\r
277 * jalview.schemabinding.version2.Features at the given index
\r
279 public jalview.schemabinding.version2.Features getFeatures(
\r
281 throws java.lang.IndexOutOfBoundsException {
\r
282 // check bounds for index
\r
283 if (index < 0 || index >= this._featuresList.size()) {
\r
284 throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
\r
287 return (jalview.schemabinding.version2.Features) _featuresList.get(index);
\r
291 * Method getFeatures.Returns the contents of the collection in
\r
292 * an Array. <p>Note: Just in case the collection contents
\r
293 * are changing in another thread, we pass a 0-length Array of
\r
294 * the correct type into the API call. This way we <i>know</i>
\r
295 * that the Array returned is of exactly the correct length.
\r
297 * @return this collection as an Array
\r
299 public jalview.schemabinding.version2.Features[] getFeatures(
\r
301 jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
\r
302 return (jalview.schemabinding.version2.Features[]) this._featuresList.toArray(array);
\r
306 * Method getFeaturesCount.
\r
308 * @return the size of this collection
\r
310 public int getFeaturesCount(
\r
312 return this._featuresList.size();
\r
316 * Returns the value of field 'hidden'.
\r
318 * @return the value of field 'Hidden'.
\r
320 public boolean getHidden(
\r
322 return this._hidden;
\r
326 * Method getHiddenSequences.
\r
329 * @throws java.lang.IndexOutOfBoundsException if the index
\r
330 * given is outside the bounds of the collection
\r
331 * @return the value of the int at the given index
\r
333 public int getHiddenSequences(
\r
335 throws java.lang.IndexOutOfBoundsException {
\r
336 // check bounds for index
\r
337 if (index < 0 || index >= this._hiddenSequencesList.size()) {
\r
338 throw new IndexOutOfBoundsException("getHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
\r
341 return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
\r
345 * Method getHiddenSequences.Returns the contents of the
\r
346 * collection in an Array.
\r
348 * @return this collection as an Array
\r
350 public int[] getHiddenSequences(
\r
352 int size = this._hiddenSequencesList.size();
\r
353 int[] array = new int[size];
\r
354 java.util.Iterator iter = _hiddenSequencesList.iterator();
\r
355 for (int index = 0; index < size; index++) {
\r
356 array[index] = ((java.lang.Integer) iter.next()).intValue();
\r
362 * Method getHiddenSequencesCount.
\r
364 * @return the size of this collection
\r
366 public int getHiddenSequencesCount(
\r
368 return this._hiddenSequencesList.size();
\r
372 * Returns the value of field 'id'.
\r
374 * @return the value of field 'Id'.
\r
376 public java.lang.String getId(
\r
382 * Method getPdbids.
\r
385 * @throws java.lang.IndexOutOfBoundsException if the index
\r
386 * given is outside the bounds of the collection
\r
387 * @return the value of the
\r
388 * jalview.schemabinding.version2.Pdbids at the given index
\r
390 public jalview.schemabinding.version2.Pdbids getPdbids(
\r
392 throws java.lang.IndexOutOfBoundsException {
\r
393 // check bounds for index
\r
394 if (index < 0 || index >= this._pdbidsList.size()) {
\r
395 throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
\r
398 return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
\r
402 * Method getPdbids.Returns the contents of the collection in
\r
403 * an Array. <p>Note: Just in case the collection contents
\r
404 * are changing in another thread, we pass a 0-length Array of
\r
405 * the correct type into the API call. This way we <i>know</i>
\r
406 * that the Array returned is of exactly the correct length.
\r
408 * @return this collection as an Array
\r
410 public jalview.schemabinding.version2.Pdbids[] getPdbids(
\r
412 jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
\r
413 return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList.toArray(array);
\r
417 * Method getPdbidsCount.
\r
419 * @return the size of this collection
\r
421 public int getPdbidsCount(
\r
423 return this._pdbidsList.size();
\r
427 * Returns the value of field 'start'.
\r
429 * @return the value of field 'Start'.
\r
431 public int getStart(
\r
433 return this._start;
\r
437 * Method hasColour.
\r
439 * @return true if at least one Colour has been added
\r
441 public boolean hasColour(
\r
443 return this._has_colour;
\r
449 * @return true if at least one End has been added
\r
451 public boolean hasEnd(
\r
453 return this._has_end;
\r
457 * Method hasHidden.
\r
459 * @return true if at least one Hidden has been added
\r
461 public boolean hasHidden(
\r
463 return this._has_hidden;
\r
469 * @return true if at least one Start has been added
\r
471 public boolean hasStart(
\r
473 return this._has_start;
\r
477 * Returns the value of field 'hidden'.
\r
479 * @return the value of field 'Hidden'.
\r
481 public boolean isHidden(
\r
483 return this._hidden;
\r
489 * @return true if this object is valid according to the schema
\r
491 public boolean isValid(
\r
495 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
505 * @throws org.exolab.castor.xml.MarshalException if object is
\r
506 * null or if any SAXException is thrown during marshaling
\r
507 * @throws org.exolab.castor.xml.ValidationException if this
\r
508 * object is an invalid instance according to the schema
\r
510 public void marshal(
\r
511 final java.io.Writer out)
\r
512 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
513 Marshaller.marshal(this, out);
\r
520 * @throws java.io.IOException if an IOException occurs during
\r
522 * @throws org.exolab.castor.xml.ValidationException if this
\r
523 * object is an invalid instance according to the schema
\r
524 * @throws org.exolab.castor.xml.MarshalException if object is
\r
525 * null or if any SAXException is thrown during marshaling
\r
527 public void marshal(
\r
528 final org.xml.sax.ContentHandler handler)
\r
529 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
530 Marshaller.marshal(this, handler);
\r
535 public void removeAllFeatures(
\r
537 this._featuresList.clear();
\r
542 public void removeAllHiddenSequences(
\r
544 this._hiddenSequencesList.clear();
\r
549 public void removeAllPdbids(
\r
551 this._pdbidsList.clear();
\r
555 * Method removeFeatures.
\r
558 * @return true if the object was removed from the collection.
\r
560 public boolean removeFeatures(
\r
561 final jalview.schemabinding.version2.Features vFeatures) {
\r
562 boolean removed = _featuresList.remove(vFeatures);
\r
567 * Method removeFeaturesAt.
\r
570 * @return the element removed from the collection
\r
572 public jalview.schemabinding.version2.Features removeFeaturesAt(
\r
574 java.lang.Object obj = this._featuresList.remove(index);
\r
575 return (jalview.schemabinding.version2.Features) obj;
\r
579 * Method removeHiddenSequences.
\r
581 * @param vHiddenSequences
\r
582 * @return true if the object was removed from the collection.
\r
584 public boolean removeHiddenSequences(
\r
585 final int vHiddenSequences) {
\r
586 boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(vHiddenSequences));
\r
591 * Method removeHiddenSequencesAt.
\r
594 * @return the element removed from the collection
\r
596 public int removeHiddenSequencesAt(
\r
598 java.lang.Object obj = this._hiddenSequencesList.remove(index);
\r
599 return ((java.lang.Integer) obj).intValue();
\r
603 * Method removePdbids.
\r
606 * @return true if the object was removed from the collection.
\r
608 public boolean removePdbids(
\r
609 final jalview.schemabinding.version2.Pdbids vPdbids) {
\r
610 boolean removed = _pdbidsList.remove(vPdbids);
\r
615 * Method removePdbidsAt.
\r
618 * @return the element removed from the collection
\r
620 public jalview.schemabinding.version2.Pdbids removePdbidsAt(
\r
622 java.lang.Object obj = this._pdbidsList.remove(index);
\r
623 return (jalview.schemabinding.version2.Pdbids) obj;
\r
627 * Sets the value of field 'colour'.
\r
629 * @param colour the value of field 'colour'.
\r
631 public void setColour(
\r
632 final int colour) {
\r
633 this._colour = colour;
\r
634 this._has_colour = true;
\r
638 * Sets the value of field 'end'.
\r
640 * @param end the value of field 'end'.
\r
642 public void setEnd(
\r
645 this._has_end = true;
\r
653 * @throws java.lang.IndexOutOfBoundsException if the index
\r
654 * given is outside the bounds of the collection
\r
656 public void setFeatures(
\r
658 final jalview.schemabinding.version2.Features vFeatures)
\r
659 throws java.lang.IndexOutOfBoundsException {
\r
660 // check bounds for index
\r
661 if (index < 0 || index >= this._featuresList.size()) {
\r
662 throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
\r
665 this._featuresList.set(index, vFeatures);
\r
671 * @param vFeaturesArray
\r
673 public void setFeatures(
\r
674 final jalview.schemabinding.version2.Features[] vFeaturesArray) {
\r
676 _featuresList.clear();
\r
678 for (int i = 0; i < vFeaturesArray.length; i++) {
\r
679 this._featuresList.add(vFeaturesArray[i]);
\r
684 * Sets the value of field 'hidden'.
\r
686 * @param hidden the value of field 'hidden'.
\r
688 public void setHidden(
\r
689 final boolean hidden) {
\r
690 this._hidden = hidden;
\r
691 this._has_hidden = true;
\r
698 * @param vHiddenSequences
\r
699 * @throws java.lang.IndexOutOfBoundsException if the index
\r
700 * given is outside the bounds of the collection
\r
702 public void setHiddenSequences(
\r
704 final int vHiddenSequences)
\r
705 throws java.lang.IndexOutOfBoundsException {
\r
706 // check bounds for index
\r
707 if (index < 0 || index >= this._hiddenSequencesList.size()) {
\r
708 throw new IndexOutOfBoundsException("setHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
\r
711 this._hiddenSequencesList.set(index, new java.lang.Integer(vHiddenSequences));
\r
717 * @param vHiddenSequencesArray
\r
719 public void setHiddenSequences(
\r
720 final int[] vHiddenSequencesArray) {
\r
722 _hiddenSequencesList.clear();
\r
724 for (int i = 0; i < vHiddenSequencesArray.length; i++) {
\r
725 this._hiddenSequencesList.add(new java.lang.Integer(vHiddenSequencesArray[i]));
\r
730 * Sets the value of field 'id'.
\r
732 * @param id the value of field 'id'.
\r
735 final java.lang.String id) {
\r
744 * @throws java.lang.IndexOutOfBoundsException if the index
\r
745 * given is outside the bounds of the collection
\r
747 public void setPdbids(
\r
749 final jalview.schemabinding.version2.Pdbids vPdbids)
\r
750 throws java.lang.IndexOutOfBoundsException {
\r
751 // check bounds for index
\r
752 if (index < 0 || index >= this._pdbidsList.size()) {
\r
753 throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
\r
756 this._pdbidsList.set(index, vPdbids);
\r
762 * @param vPdbidsArray
\r
764 public void setPdbids(
\r
765 final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) {
\r
767 _pdbidsList.clear();
\r
769 for (int i = 0; i < vPdbidsArray.length; i++) {
\r
770 this._pdbidsList.add(vPdbidsArray[i]);
\r
775 * Sets the value of field 'start'.
\r
777 * @param start the value of field 'start'.
\r
779 public void setStart(
\r
781 this._start = start;
\r
782 this._has_start = true;
\r
786 * Method unmarshal.
\r
789 * @throws org.exolab.castor.xml.MarshalException if object is
\r
790 * null or if any SAXException is thrown during marshaling
\r
791 * @throws org.exolab.castor.xml.ValidationException if this
\r
792 * object is an invalid instance according to the schema
\r
793 * @return the unmarshaled jalview.schemabinding.version2.JSeq
\r
795 public static jalview.schemabinding.version2.JSeq unmarshal(
\r
796 final java.io.Reader reader)
\r
797 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
798 return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(jalview.schemabinding.version2.JSeq.class, reader);
\r
804 * @throws org.exolab.castor.xml.ValidationException if this
\r
805 * object is an invalid instance according to the schema
\r
807 public void validate(
\r
809 throws org.exolab.castor.xml.ValidationException {
\r
810 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
811 validator.validate(this);
\r