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();
109 * @throws java.lang.IndexOutOfBoundsException
110 * if the index given is outside the bounds of the collection
112 public void addFeatures(
113 final jalview.schemabinding.version2.Features vFeatures)
114 throws java.lang.IndexOutOfBoundsException
116 this._featuresList.addElement(vFeatures);
124 * @throws java.lang.IndexOutOfBoundsException
125 * if the index given is outside the bounds of the collection
127 public void addFeatures(final int index,
128 final jalview.schemabinding.version2.Features vFeatures)
129 throws java.lang.IndexOutOfBoundsException
131 this._featuresList.add(index, vFeatures);
137 * @param vHiddenSequences
138 * @throws java.lang.IndexOutOfBoundsException
139 * if the index given is outside the bounds of the collection
141 public void addHiddenSequences(final int vHiddenSequences)
142 throws java.lang.IndexOutOfBoundsException
144 this._hiddenSequencesList.addElement(new java.lang.Integer(
152 * @param vHiddenSequences
153 * @throws java.lang.IndexOutOfBoundsException
154 * if the index given is outside the bounds of the collection
156 public void addHiddenSequences(final int index, final int vHiddenSequences)
157 throws java.lang.IndexOutOfBoundsException
159 this._hiddenSequencesList.add(index, new java.lang.Integer(
167 * @throws java.lang.IndexOutOfBoundsException
168 * if the index given is outside the bounds of the collection
170 public void addPdbids(final jalview.schemabinding.version2.Pdbids vPdbids)
171 throws java.lang.IndexOutOfBoundsException
173 this._pdbidsList.addElement(vPdbids);
181 * @throws java.lang.IndexOutOfBoundsException
182 * if the index given is outside the bounds of the collection
184 public void addPdbids(final int index,
185 final jalview.schemabinding.version2.Pdbids vPdbids)
186 throws java.lang.IndexOutOfBoundsException
188 this._pdbidsList.add(index, vPdbids);
193 public void deleteColour()
195 this._has_colour = false;
200 public void deleteEnd()
202 this._has_end = false;
207 public void deleteHidden()
209 this._has_hidden = false;
214 public void deleteStart()
216 this._has_start = false;
220 * Method enumerateFeatures.
222 * @return an Enumeration over all jalview.schemabinding.version2.Features
225 public java.util.Enumeration enumerateFeatures()
227 return this._featuresList.elements();
231 * Method enumerateHiddenSequences.
233 * @return an Enumeration over all int elements
235 public java.util.Enumeration enumerateHiddenSequences()
237 return this._hiddenSequencesList.elements();
241 * Method enumeratePdbids.
243 * @return an Enumeration over all jalview.schemabinding.version2.Pdbids
246 public java.util.Enumeration enumeratePdbids()
248 return this._pdbidsList.elements();
252 * Returns the value of field 'colour'.
254 * @return the value of field 'Colour'.
256 public int getColour()
262 * Returns the value of field 'end'.
264 * @return the value of field 'End'.
272 * Method getFeatures.
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
280 public jalview.schemabinding.version2.Features getFeatures(final int index)
281 throws java.lang.IndexOutOfBoundsException
283 // check bounds for index
284 if (index < 0 || index >= this._featuresList.size())
286 throw new IndexOutOfBoundsException("getFeatures: Index value '"
287 + index + "' not in range [0.."
288 + (this._featuresList.size() - 1) + "]");
291 return (jalview.schemabinding.version2.Features) _featuresList
296 * Method getFeatures.Returns the contents of the collection in an Array.
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.
302 * @return this collection as an Array
304 public jalview.schemabinding.version2.Features[] getFeatures()
306 jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
307 return (jalview.schemabinding.version2.Features[]) this._featuresList
312 * Method getFeaturesCount.
314 * @return the size of this collection
316 public int getFeaturesCount()
318 return this._featuresList.size();
322 * Returns the value of field 'hidden'.
324 * @return the value of field 'Hidden'.
326 public boolean getHidden()
332 * Method getHiddenSequences.
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
339 public int getHiddenSequences(final int index)
340 throws java.lang.IndexOutOfBoundsException
342 // check bounds for index
343 if (index < 0 || index >= this._hiddenSequencesList.size())
345 throw new IndexOutOfBoundsException(
346 "getHiddenSequences: Index value '" + index
347 + "' not in range [0.."
348 + (this._hiddenSequencesList.size() - 1) + "]");
351 return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
355 * Method getHiddenSequences.Returns the contents of the collection in an
358 * @return this collection as an Array
360 public int[] getHiddenSequences()
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++)
367 array[index] = ((java.lang.Integer) iter.next()).intValue();
373 * Method getHiddenSequencesCount.
375 * @return the size of this collection
377 public int getHiddenSequencesCount()
379 return this._hiddenSequencesList.size();
383 * Returns the value of field 'id'.
385 * @return the value of field 'Id'.
387 public java.lang.String getId()
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
401 public jalview.schemabinding.version2.Pdbids getPdbids(final int index)
402 throws java.lang.IndexOutOfBoundsException
404 // check bounds for index
405 if (index < 0 || index >= this._pdbidsList.size())
407 throw new IndexOutOfBoundsException("getPdbids: Index value '"
408 + index + "' not in range [0.."
409 + (this._pdbidsList.size() - 1) + "]");
412 return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
416 * Method getPdbids.Returns the contents of the collection in an Array.
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.
422 * @return this collection as an Array
424 public jalview.schemabinding.version2.Pdbids[] getPdbids()
426 jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
427 return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList
432 * Method getPdbidsCount.
434 * @return the size of this collection
436 public int getPdbidsCount()
438 return this._pdbidsList.size();
442 * Returns the value of field 'start'.
444 * @return the value of field 'Start'.
446 public int getStart()
454 * @return true if at least one Colour has been added
456 public boolean hasColour()
458 return this._has_colour;
464 * @return true if at least one End has been added
466 public boolean hasEnd()
468 return this._has_end;
474 * @return true if at least one Hidden has been added
476 public boolean hasHidden()
478 return this._has_hidden;
484 * @return true if at least one Start has been added
486 public boolean hasStart()
488 return this._has_start;
492 * Returns the value of field 'hidden'.
494 * @return the value of field 'Hidden'.
496 public boolean isHidden()
504 * @return true if this object is valid according to the schema
506 public boolean isValid()
511 } catch (org.exolab.castor.xml.ValidationException vex)
522 * @throws org.exolab.castor.xml.MarshalException
523 * if object is null or if any SAXException is thrown during
525 * @throws org.exolab.castor.xml.ValidationException
526 * if this object is an invalid instance according to the schema
528 public void marshal(final java.io.Writer out)
529 throws org.exolab.castor.xml.MarshalException,
530 org.exolab.castor.xml.ValidationException
532 Marshaller.marshal(this, out);
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
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
552 Marshaller.marshal(this, handler);
557 public void removeAllFeatures()
559 this._featuresList.clear();
564 public void removeAllHiddenSequences()
566 this._hiddenSequencesList.clear();
571 public void removeAllPdbids()
573 this._pdbidsList.clear();
577 * Method removeFeatures.
580 * @return true if the object was removed from the collection.
582 public boolean removeFeatures(
583 final jalview.schemabinding.version2.Features vFeatures)
585 boolean removed = _featuresList.remove(vFeatures);
590 * Method removeFeaturesAt.
593 * @return the element removed from the collection
595 public jalview.schemabinding.version2.Features removeFeaturesAt(
598 java.lang.Object obj = this._featuresList.remove(index);
599 return (jalview.schemabinding.version2.Features) obj;
603 * Method removeHiddenSequences.
605 * @param vHiddenSequences
606 * @return true if the object was removed from the collection.
608 public boolean removeHiddenSequences(final int vHiddenSequences)
610 boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(
616 * Method removeHiddenSequencesAt.
619 * @return the element removed from the collection
621 public int removeHiddenSequencesAt(final int index)
623 java.lang.Object obj = this._hiddenSequencesList.remove(index);
624 return ((java.lang.Integer) obj).intValue();
628 * Method removePdbids.
631 * @return true if the object was removed from the collection.
633 public boolean removePdbids(
634 final jalview.schemabinding.version2.Pdbids vPdbids)
636 boolean removed = _pdbidsList.remove(vPdbids);
641 * Method removePdbidsAt.
644 * @return the element removed from the collection
646 public jalview.schemabinding.version2.Pdbids removePdbidsAt(
649 java.lang.Object obj = this._pdbidsList.remove(index);
650 return (jalview.schemabinding.version2.Pdbids) obj;
654 * Sets the value of field 'colour'.
657 * the value of field 'colour'.
659 public void setColour(final int colour)
661 this._colour = colour;
662 this._has_colour = true;
666 * Sets the value of field 'end'.
669 * the value of field 'end'.
671 public void setEnd(final int end)
674 this._has_end = true;
682 * @throws java.lang.IndexOutOfBoundsException
683 * if the index given is outside the bounds of the collection
685 public void setFeatures(final int index,
686 final jalview.schemabinding.version2.Features vFeatures)
687 throws java.lang.IndexOutOfBoundsException
689 // check bounds for index
690 if (index < 0 || index >= this._featuresList.size())
692 throw new IndexOutOfBoundsException("setFeatures: Index value '"
693 + index + "' not in range [0.."
694 + (this._featuresList.size() - 1) + "]");
697 this._featuresList.set(index, vFeatures);
703 * @param vFeaturesArray
705 public void setFeatures(
706 final jalview.schemabinding.version2.Features[] vFeaturesArray)
709 _featuresList.clear();
711 for (int i = 0; i < vFeaturesArray.length; i++)
713 this._featuresList.add(vFeaturesArray[i]);
718 * Sets the value of field 'hidden'.
721 * the value of field 'hidden'.
723 public void setHidden(final boolean hidden)
725 this._hidden = hidden;
726 this._has_hidden = true;
733 * @param vHiddenSequences
734 * @throws java.lang.IndexOutOfBoundsException
735 * if the index given is outside the bounds of the collection
737 public void setHiddenSequences(final int index, final int vHiddenSequences)
738 throws java.lang.IndexOutOfBoundsException
740 // check bounds for index
741 if (index < 0 || index >= this._hiddenSequencesList.size())
743 throw new IndexOutOfBoundsException(
744 "setHiddenSequences: Index value '" + index
745 + "' not in range [0.."
746 + (this._hiddenSequencesList.size() - 1) + "]");
749 this._hiddenSequencesList.set(index, new java.lang.Integer(
756 * @param vHiddenSequencesArray
758 public void setHiddenSequences(final int[] vHiddenSequencesArray)
761 _hiddenSequencesList.clear();
763 for (int i = 0; i < vHiddenSequencesArray.length; i++)
765 this._hiddenSequencesList.add(new java.lang.Integer(
766 vHiddenSequencesArray[i]));
771 * Sets the value of field 'id'.
774 * the value of field 'id'.
776 public void setId(final java.lang.String id)
786 * @throws java.lang.IndexOutOfBoundsException
787 * if the index given is outside the bounds of the collection
789 public void setPdbids(final int index,
790 final jalview.schemabinding.version2.Pdbids vPdbids)
791 throws java.lang.IndexOutOfBoundsException
793 // check bounds for index
794 if (index < 0 || index >= this._pdbidsList.size())
796 throw new IndexOutOfBoundsException("setPdbids: Index value '"
797 + index + "' not in range [0.."
798 + (this._pdbidsList.size() - 1) + "]");
801 this._pdbidsList.set(index, vPdbids);
807 * @param vPdbidsArray
809 public void setPdbids(
810 final jalview.schemabinding.version2.Pdbids[] vPdbidsArray)
815 for (int i = 0; i < vPdbidsArray.length; i++)
817 this._pdbidsList.add(vPdbidsArray[i]);
822 * Sets the value of field 'start'.
825 * the value of field 'start'.
827 public void setStart(final int start)
830 this._has_start = true;
837 * @throws org.exolab.castor.xml.MarshalException
838 * if object is null or if any SAXException is thrown during
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
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
849 return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(
850 jalview.schemabinding.version2.JSeq.class, reader);
856 * @throws org.exolab.castor.xml.ValidationException
857 * if this object is an invalid instance according to the schema
859 public void validate() throws org.exolab.castor.xml.ValidationException
861 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
862 validator.validate(this);