2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class JSeq implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
35 * keeps track of state for field: _colour
37 private boolean _has_colour;
45 * keeps track of state for field: _start
47 private boolean _has_start;
55 * keeps track of state for field: _end
57 private boolean _has_end;
62 private java.lang.String _id;
67 private boolean _hidden;
70 * keeps track of state for field: _hidden
72 private boolean _has_hidden;
75 * Field _featuresList.
77 private java.util.Vector _featuresList;
82 private java.util.Vector _pdbidsList;
85 * Field _hiddenSequencesList.
87 private java.util.Vector _hiddenSequencesList;
96 this._featuresList = new java.util.Vector();
97 this._pdbidsList = new java.util.Vector();
98 this._hiddenSequencesList = new java.util.Vector();
110 * @throws java.lang.IndexOutOfBoundsException if the index
111 * given is outside the bounds of the collection
113 public void addFeatures(
114 final jalview.schemabinding.version2.Features vFeatures)
115 throws java.lang.IndexOutOfBoundsException {
116 this._featuresList.addElement(vFeatures);
124 * @throws java.lang.IndexOutOfBoundsException if the index
125 * given is outside the bounds of the collection
127 public void addFeatures(
129 final jalview.schemabinding.version2.Features vFeatures)
130 throws java.lang.IndexOutOfBoundsException {
131 this._featuresList.add(index, vFeatures);
137 * @param vHiddenSequences
138 * @throws java.lang.IndexOutOfBoundsException if the index
139 * given is outside the bounds of the collection
141 public void addHiddenSequences(
142 final int vHiddenSequences)
143 throws java.lang.IndexOutOfBoundsException {
144 this._hiddenSequencesList.addElement(new java.lang.Integer(vHiddenSequences));
151 * @param vHiddenSequences
152 * @throws java.lang.IndexOutOfBoundsException if the index
153 * given is outside the bounds of the collection
155 public void addHiddenSequences(
157 final int vHiddenSequences)
158 throws java.lang.IndexOutOfBoundsException {
159 this._hiddenSequencesList.add(index, new java.lang.Integer(vHiddenSequences));
166 * @throws java.lang.IndexOutOfBoundsException if the index
167 * given is outside the bounds of the collection
169 public void addPdbids(
170 final jalview.schemabinding.version2.Pdbids vPdbids)
171 throws java.lang.IndexOutOfBoundsException {
172 this._pdbidsList.addElement(vPdbids);
180 * @throws java.lang.IndexOutOfBoundsException if the index
181 * given is outside the bounds of the collection
183 public void addPdbids(
185 final jalview.schemabinding.version2.Pdbids vPdbids)
186 throws java.lang.IndexOutOfBoundsException {
187 this._pdbidsList.add(index, vPdbids);
192 public void deleteColour(
194 this._has_colour= false;
199 public void deleteEnd(
201 this._has_end= false;
206 public void deleteHidden(
208 this._has_hidden= false;
213 public void deleteStart(
215 this._has_start= false;
219 * Method enumerateFeatures.
221 * @return an Enumeration over all
222 * jalview.schemabinding.version2.Features elements
224 public java.util.Enumeration enumerateFeatures(
226 return this._featuresList.elements();
230 * Method enumerateHiddenSequences.
232 * @return an Enumeration over all int elements
234 public java.util.Enumeration enumerateHiddenSequences(
236 return this._hiddenSequencesList.elements();
240 * Method enumeratePdbids.
242 * @return an Enumeration over all
243 * jalview.schemabinding.version2.Pdbids elements
245 public java.util.Enumeration enumeratePdbids(
247 return this._pdbidsList.elements();
251 * Returns the value of field 'colour'.
253 * @return the value of field 'Colour'.
255 public int getColour(
261 * Returns the value of field 'end'.
263 * @return the value of field 'End'.
271 * Method getFeatures.
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
279 public jalview.schemabinding.version2.Features getFeatures(
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) + "]");
287 return (jalview.schemabinding.version2.Features) _featuresList.get(index);
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.
297 * @return this collection as an Array
299 public jalview.schemabinding.version2.Features[] getFeatures(
301 jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
302 return (jalview.schemabinding.version2.Features[]) this._featuresList.toArray(array);
306 * Method getFeaturesCount.
308 * @return the size of this collection
310 public int getFeaturesCount(
312 return this._featuresList.size();
316 * Returns the value of field 'hidden'.
318 * @return the value of field 'Hidden'.
320 public boolean getHidden(
326 * Method getHiddenSequences.
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
333 public int getHiddenSequences(
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) + "]");
341 return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
345 * Method getHiddenSequences.Returns the contents of the
346 * collection in an Array.
348 * @return this collection as an Array
350 public int[] getHiddenSequences(
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();
362 * Method getHiddenSequencesCount.
364 * @return the size of this collection
366 public int getHiddenSequencesCount(
368 return this._hiddenSequencesList.size();
372 * Returns the value of field 'id'.
374 * @return the value of field 'Id'.
376 public java.lang.String getId(
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
390 public jalview.schemabinding.version2.Pdbids getPdbids(
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) + "]");
398 return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
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.
408 * @return this collection as an Array
410 public jalview.schemabinding.version2.Pdbids[] getPdbids(
412 jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
413 return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList.toArray(array);
417 * Method getPdbidsCount.
419 * @return the size of this collection
421 public int getPdbidsCount(
423 return this._pdbidsList.size();
427 * Returns the value of field 'start'.
429 * @return the value of field 'Start'.
439 * @return true if at least one Colour has been added
441 public boolean hasColour(
443 return this._has_colour;
449 * @return true if at least one End has been added
451 public boolean hasEnd(
453 return this._has_end;
459 * @return true if at least one Hidden has been added
461 public boolean hasHidden(
463 return this._has_hidden;
469 * @return true if at least one Start has been added
471 public boolean hasStart(
473 return this._has_start;
477 * Returns the value of field 'hidden'.
479 * @return the value of field 'Hidden'.
481 public boolean isHidden(
489 * @return true if this object is valid according to the schema
491 public boolean isValid(
495 } catch (org.exolab.castor.xml.ValidationException vex) {
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
511 final java.io.Writer out)
512 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
513 Marshaller.marshal(this, out);
520 * @throws java.io.IOException if an IOException occurs during
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
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);
535 public void removeAllFeatures(
537 this._featuresList.clear();
542 public void removeAllHiddenSequences(
544 this._hiddenSequencesList.clear();
549 public void removeAllPdbids(
551 this._pdbidsList.clear();
555 * Method removeFeatures.
558 * @return true if the object was removed from the collection.
560 public boolean removeFeatures(
561 final jalview.schemabinding.version2.Features vFeatures) {
562 boolean removed = _featuresList.remove(vFeatures);
567 * Method removeFeaturesAt.
570 * @return the element removed from the collection
572 public jalview.schemabinding.version2.Features removeFeaturesAt(
574 java.lang.Object obj = this._featuresList.remove(index);
575 return (jalview.schemabinding.version2.Features) obj;
579 * Method removeHiddenSequences.
581 * @param vHiddenSequences
582 * @return true if the object was removed from the collection.
584 public boolean removeHiddenSequences(
585 final int vHiddenSequences) {
586 boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(vHiddenSequences));
591 * Method removeHiddenSequencesAt.
594 * @return the element removed from the collection
596 public int removeHiddenSequencesAt(
598 java.lang.Object obj = this._hiddenSequencesList.remove(index);
599 return ((java.lang.Integer) obj).intValue();
603 * Method removePdbids.
606 * @return true if the object was removed from the collection.
608 public boolean removePdbids(
609 final jalview.schemabinding.version2.Pdbids vPdbids) {
610 boolean removed = _pdbidsList.remove(vPdbids);
615 * Method removePdbidsAt.
618 * @return the element removed from the collection
620 public jalview.schemabinding.version2.Pdbids removePdbidsAt(
622 java.lang.Object obj = this._pdbidsList.remove(index);
623 return (jalview.schemabinding.version2.Pdbids) obj;
627 * Sets the value of field 'colour'.
629 * @param colour the value of field 'colour'.
631 public void setColour(
633 this._colour = colour;
634 this._has_colour = true;
638 * Sets the value of field 'end'.
640 * @param end the value of field 'end'.
645 this._has_end = true;
653 * @throws java.lang.IndexOutOfBoundsException if the index
654 * given is outside the bounds of the collection
656 public void setFeatures(
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) + "]");
665 this._featuresList.set(index, vFeatures);
671 * @param vFeaturesArray
673 public void setFeatures(
674 final jalview.schemabinding.version2.Features[] vFeaturesArray) {
676 _featuresList.clear();
678 for (int i = 0; i < vFeaturesArray.length; i++) {
679 this._featuresList.add(vFeaturesArray[i]);
684 * Sets the value of field 'hidden'.
686 * @param hidden the value of field 'hidden'.
688 public void setHidden(
689 final boolean hidden) {
690 this._hidden = hidden;
691 this._has_hidden = true;
698 * @param vHiddenSequences
699 * @throws java.lang.IndexOutOfBoundsException if the index
700 * given is outside the bounds of the collection
702 public void setHiddenSequences(
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) + "]");
711 this._hiddenSequencesList.set(index, new java.lang.Integer(vHiddenSequences));
717 * @param vHiddenSequencesArray
719 public void setHiddenSequences(
720 final int[] vHiddenSequencesArray) {
722 _hiddenSequencesList.clear();
724 for (int i = 0; i < vHiddenSequencesArray.length; i++) {
725 this._hiddenSequencesList.add(new java.lang.Integer(vHiddenSequencesArray[i]));
730 * Sets the value of field 'id'.
732 * @param id the value of field 'id'.
735 final java.lang.String id) {
744 * @throws java.lang.IndexOutOfBoundsException if the index
745 * given is outside the bounds of the collection
747 public void setPdbids(
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) + "]");
756 this._pdbidsList.set(index, vPdbids);
762 * @param vPdbidsArray
764 public void setPdbids(
765 final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) {
769 for (int i = 0; i < vPdbidsArray.length; i++) {
770 this._pdbidsList.add(vPdbidsArray[i]);
775 * Sets the value of field 'start'.
777 * @param start the value of field 'start'.
779 public void setStart(
782 this._has_start = true;
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
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);
804 * @throws org.exolab.castor.xml.ValidationException if this
805 * object is an invalid instance according to the schema
807 public void validate(
809 throws org.exolab.castor.xml.ValidationException {
810 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
811 validator.validate(this);