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
18 * Class JalviewModelSequence.
\r
20 * @version $Revision$ $Date$
\r
22 public class JalviewModelSequence implements java.io.Serializable {
\r
25 //--------------------------/
\r
26 //- Class/Member Variables -/
\r
27 //--------------------------/
\r
32 private java.util.Vector _JSeqList;
\r
35 * Field _JGroupList.
\r
37 private java.util.Vector _JGroupList;
\r
40 * Field _viewportList.
\r
42 private java.util.Vector _viewportList;
\r
45 * Field _userColoursList.
\r
47 private java.util.Vector _userColoursList;
\r
52 private java.util.Vector _treeList;
\r
55 * Field _featureSettings.
\r
57 private jalview.schemabinding.version2.FeatureSettings _featureSettings;
\r
64 public JalviewModelSequence() {
\r
66 this._JSeqList = new java.util.Vector();
\r
67 this._JGroupList = new java.util.Vector();
\r
68 this._viewportList = new java.util.Vector();
\r
69 this._userColoursList = new java.util.Vector();
\r
70 this._treeList = new java.util.Vector();
\r
82 * @throws java.lang.IndexOutOfBoundsException if the index
\r
83 * given is outside the bounds of the collection
\r
85 public void addJGroup(
\r
86 final jalview.schemabinding.version2.JGroup vJGroup)
\r
87 throws java.lang.IndexOutOfBoundsException {
\r
88 this._JGroupList.addElement(vJGroup);
\r
96 * @throws java.lang.IndexOutOfBoundsException if the index
\r
97 * given is outside the bounds of the collection
\r
99 public void addJGroup(
\r
101 final jalview.schemabinding.version2.JGroup vJGroup)
\r
102 throws java.lang.IndexOutOfBoundsException {
\r
103 this._JGroupList.add(index, vJGroup);
\r
110 * @throws java.lang.IndexOutOfBoundsException if the index
\r
111 * given is outside the bounds of the collection
\r
113 public void addJSeq(
\r
114 final jalview.schemabinding.version2.JSeq vJSeq)
\r
115 throws java.lang.IndexOutOfBoundsException {
\r
116 this._JSeqList.addElement(vJSeq);
\r
124 * @throws java.lang.IndexOutOfBoundsException if the index
\r
125 * given is outside the bounds of the collection
\r
127 public void addJSeq(
\r
129 final jalview.schemabinding.version2.JSeq vJSeq)
\r
130 throws java.lang.IndexOutOfBoundsException {
\r
131 this._JSeqList.add(index, vJSeq);
\r
138 * @throws java.lang.IndexOutOfBoundsException if the index
\r
139 * given is outside the bounds of the collection
\r
141 public void addTree(
\r
142 final jalview.schemabinding.version2.Tree vTree)
\r
143 throws java.lang.IndexOutOfBoundsException {
\r
144 this._treeList.addElement(vTree);
\r
152 * @throws java.lang.IndexOutOfBoundsException if the index
\r
153 * given is outside the bounds of the collection
\r
155 public void addTree(
\r
157 final jalview.schemabinding.version2.Tree vTree)
\r
158 throws java.lang.IndexOutOfBoundsException {
\r
159 this._treeList.add(index, vTree);
\r
165 * @param vUserColours
\r
166 * @throws java.lang.IndexOutOfBoundsException if the index
\r
167 * given is outside the bounds of the collection
\r
169 public void addUserColours(
\r
170 final jalview.schemabinding.version2.UserColours vUserColours)
\r
171 throws java.lang.IndexOutOfBoundsException {
\r
172 this._userColoursList.addElement(vUserColours);
\r
179 * @param vUserColours
\r
180 * @throws java.lang.IndexOutOfBoundsException if the index
\r
181 * given is outside the bounds of the collection
\r
183 public void addUserColours(
\r
185 final jalview.schemabinding.version2.UserColours vUserColours)
\r
186 throws java.lang.IndexOutOfBoundsException {
\r
187 this._userColoursList.add(index, vUserColours);
\r
194 * @throws java.lang.IndexOutOfBoundsException if the index
\r
195 * given is outside the bounds of the collection
\r
197 public void addViewport(
\r
198 final jalview.schemabinding.version2.Viewport vViewport)
\r
199 throws java.lang.IndexOutOfBoundsException {
\r
200 this._viewportList.addElement(vViewport);
\r
208 * @throws java.lang.IndexOutOfBoundsException if the index
\r
209 * given is outside the bounds of the collection
\r
211 public void addViewport(
\r
213 final jalview.schemabinding.version2.Viewport vViewport)
\r
214 throws java.lang.IndexOutOfBoundsException {
\r
215 this._viewportList.add(index, vViewport);
\r
219 * Method enumerateJGroup.
\r
221 * @return an Enumeration over all
\r
222 * jalview.schemabinding.version2.JGroup elements
\r
224 public java.util.Enumeration enumerateJGroup(
\r
226 return this._JGroupList.elements();
\r
230 * Method enumerateJSeq.
\r
232 * @return an Enumeration over all
\r
233 * jalview.schemabinding.version2.JSeq elements
\r
235 public java.util.Enumeration enumerateJSeq(
\r
237 return this._JSeqList.elements();
\r
241 * Method enumerateTree.
\r
243 * @return an Enumeration over all
\r
244 * jalview.schemabinding.version2.Tree elements
\r
246 public java.util.Enumeration enumerateTree(
\r
248 return this._treeList.elements();
\r
252 * Method enumerateUserColours.
\r
254 * @return an Enumeration over all
\r
255 * jalview.schemabinding.version2.UserColours elements
\r
257 public java.util.Enumeration enumerateUserColours(
\r
259 return this._userColoursList.elements();
\r
263 * Method enumerateViewport.
\r
265 * @return an Enumeration over all
\r
266 * jalview.schemabinding.version2.Viewport elements
\r
268 public java.util.Enumeration enumerateViewport(
\r
270 return this._viewportList.elements();
\r
274 * Returns the value of field 'featureSettings'.
\r
276 * @return the value of field 'FeatureSettings'.
\r
278 public jalview.schemabinding.version2.FeatureSettings getFeatureSettings(
\r
280 return this._featureSettings;
\r
284 * Method getJGroup.
\r
287 * @throws java.lang.IndexOutOfBoundsException if the index
\r
288 * given is outside the bounds of the collection
\r
289 * @return the value of the
\r
290 * jalview.schemabinding.version2.JGroup at the given index
\r
292 public jalview.schemabinding.version2.JGroup getJGroup(
\r
294 throws java.lang.IndexOutOfBoundsException {
\r
295 // check bounds for index
\r
296 if (index < 0 || index >= this._JGroupList.size()) {
\r
297 throw new IndexOutOfBoundsException("getJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
\r
300 return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
\r
304 * Method getJGroup.Returns the contents of the collection in
\r
305 * an Array. <p>Note: Just in case the collection contents
\r
306 * are changing in another thread, we pass a 0-length Array of
\r
307 * the correct type into the API call. This way we <i>know</i>
\r
308 * that the Array returned is of exactly the correct length.
\r
310 * @return this collection as an Array
\r
312 public jalview.schemabinding.version2.JGroup[] getJGroup(
\r
314 jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0];
\r
315 return (jalview.schemabinding.version2.JGroup[]) this._JGroupList.toArray(array);
\r
319 * Method getJGroupCount.
\r
321 * @return the size of this collection
\r
323 public int getJGroupCount(
\r
325 return this._JGroupList.size();
\r
332 * @throws java.lang.IndexOutOfBoundsException if the index
\r
333 * given is outside the bounds of the collection
\r
334 * @return the value of the jalview.schemabinding.version2.JSeq
\r
335 * at the given index
\r
337 public jalview.schemabinding.version2.JSeq getJSeq(
\r
339 throws java.lang.IndexOutOfBoundsException {
\r
340 // check bounds for index
\r
341 if (index < 0 || index >= this._JSeqList.size()) {
\r
342 throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
\r
345 return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
\r
349 * Method getJSeq.Returns the contents of the collection in an
\r
350 * Array. <p>Note: Just in case the collection contents are
\r
351 * changing in another thread, we pass a 0-length Array of the
\r
352 * correct type into the API call. This way we <i>know</i>
\r
353 * that the Array returned is of exactly the correct length.
\r
355 * @return this collection as an Array
\r
357 public jalview.schemabinding.version2.JSeq[] getJSeq(
\r
359 jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0];
\r
360 return (jalview.schemabinding.version2.JSeq[]) this._JSeqList.toArray(array);
\r
364 * Method getJSeqCount.
\r
366 * @return the size of this collection
\r
368 public int getJSeqCount(
\r
370 return this._JSeqList.size();
\r
377 * @throws java.lang.IndexOutOfBoundsException if the index
\r
378 * given is outside the bounds of the collection
\r
379 * @return the value of the jalview.schemabinding.version2.Tree
\r
380 * at the given index
\r
382 public jalview.schemabinding.version2.Tree getTree(
\r
384 throws java.lang.IndexOutOfBoundsException {
\r
385 // check bounds for index
\r
386 if (index < 0 || index >= this._treeList.size()) {
\r
387 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
\r
390 return (jalview.schemabinding.version2.Tree) _treeList.get(index);
\r
394 * Method getTree.Returns the contents of the collection in an
\r
395 * Array. <p>Note: Just in case the collection contents are
\r
396 * changing in another thread, we pass a 0-length Array of the
\r
397 * correct type into the API call. This way we <i>know</i>
\r
398 * that the Array returned is of exactly the correct length.
\r
400 * @return this collection as an Array
\r
402 public jalview.schemabinding.version2.Tree[] getTree(
\r
404 jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0];
\r
405 return (jalview.schemabinding.version2.Tree[]) this._treeList.toArray(array);
\r
409 * Method getTreeCount.
\r
411 * @return the size of this collection
\r
413 public int getTreeCount(
\r
415 return this._treeList.size();
\r
419 * Method getUserColours.
\r
422 * @throws java.lang.IndexOutOfBoundsException if the index
\r
423 * given is outside the bounds of the collection
\r
424 * @return the value of the
\r
425 * jalview.schemabinding.version2.UserColours at the given index
\r
427 public jalview.schemabinding.version2.UserColours getUserColours(
\r
429 throws java.lang.IndexOutOfBoundsException {
\r
430 // check bounds for index
\r
431 if (index < 0 || index >= this._userColoursList.size()) {
\r
432 throw new IndexOutOfBoundsException("getUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
\r
435 return (jalview.schemabinding.version2.UserColours) _userColoursList.get(index);
\r
439 * Method getUserColours.Returns the contents of the collection
\r
440 * in an Array. <p>Note: Just in case the collection contents
\r
441 * are changing in another thread, we pass a 0-length Array of
\r
442 * the correct type into the API call. This way we <i>know</i>
\r
443 * that the Array returned is of exactly the correct length.
\r
445 * @return this collection as an Array
\r
447 public jalview.schemabinding.version2.UserColours[] getUserColours(
\r
449 jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0];
\r
450 return (jalview.schemabinding.version2.UserColours[]) this._userColoursList.toArray(array);
\r
454 * Method getUserColoursCount.
\r
456 * @return the size of this collection
\r
458 public int getUserColoursCount(
\r
460 return this._userColoursList.size();
\r
464 * Method getViewport.
\r
467 * @throws java.lang.IndexOutOfBoundsException if the index
\r
468 * given is outside the bounds of the collection
\r
469 * @return the value of the
\r
470 * jalview.schemabinding.version2.Viewport at the given index
\r
472 public jalview.schemabinding.version2.Viewport getViewport(
\r
474 throws java.lang.IndexOutOfBoundsException {
\r
475 // check bounds for index
\r
476 if (index < 0 || index >= this._viewportList.size()) {
\r
477 throw new IndexOutOfBoundsException("getViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
\r
480 return (jalview.schemabinding.version2.Viewport) _viewportList.get(index);
\r
484 * Method getViewport.Returns the contents of the collection in
\r
485 * an Array. <p>Note: Just in case the collection contents
\r
486 * are changing in another thread, we pass a 0-length Array of
\r
487 * the correct type into the API call. This way we <i>know</i>
\r
488 * that the Array returned is of exactly the correct length.
\r
490 * @return this collection as an Array
\r
492 public jalview.schemabinding.version2.Viewport[] getViewport(
\r
494 jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0];
\r
495 return (jalview.schemabinding.version2.Viewport[]) this._viewportList.toArray(array);
\r
499 * Method getViewportCount.
\r
501 * @return the size of this collection
\r
503 public int getViewportCount(
\r
505 return this._viewportList.size();
\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 removeAllJGroup(
\r
559 this._JGroupList.clear();
\r
564 public void removeAllJSeq(
\r
566 this._JSeqList.clear();
\r
571 public void removeAllTree(
\r
573 this._treeList.clear();
\r
578 public void removeAllUserColours(
\r
580 this._userColoursList.clear();
\r
585 public void removeAllViewport(
\r
587 this._viewportList.clear();
\r
591 * Method removeJGroup.
\r
594 * @return true if the object was removed from the collection.
\r
596 public boolean removeJGroup(
\r
597 final jalview.schemabinding.version2.JGroup vJGroup) {
\r
598 boolean removed = _JGroupList.remove(vJGroup);
\r
603 * Method removeJGroupAt.
\r
606 * @return the element removed from the collection
\r
608 public jalview.schemabinding.version2.JGroup removeJGroupAt(
\r
610 java.lang.Object obj = this._JGroupList.remove(index);
\r
611 return (jalview.schemabinding.version2.JGroup) obj;
\r
615 * Method removeJSeq.
\r
618 * @return true if the object was removed from the collection.
\r
620 public boolean removeJSeq(
\r
621 final jalview.schemabinding.version2.JSeq vJSeq) {
\r
622 boolean removed = _JSeqList.remove(vJSeq);
\r
627 * Method removeJSeqAt.
\r
630 * @return the element removed from the collection
\r
632 public jalview.schemabinding.version2.JSeq removeJSeqAt(
\r
634 java.lang.Object obj = this._JSeqList.remove(index);
\r
635 return (jalview.schemabinding.version2.JSeq) obj;
\r
639 * Method removeTree.
\r
642 * @return true if the object was removed from the collection.
\r
644 public boolean removeTree(
\r
645 final jalview.schemabinding.version2.Tree vTree) {
\r
646 boolean removed = _treeList.remove(vTree);
\r
651 * Method removeTreeAt.
\r
654 * @return the element removed from the collection
\r
656 public jalview.schemabinding.version2.Tree removeTreeAt(
\r
658 java.lang.Object obj = this._treeList.remove(index);
\r
659 return (jalview.schemabinding.version2.Tree) obj;
\r
663 * Method removeUserColours.
\r
665 * @param vUserColours
\r
666 * @return true if the object was removed from the collection.
\r
668 public boolean removeUserColours(
\r
669 final jalview.schemabinding.version2.UserColours vUserColours) {
\r
670 boolean removed = _userColoursList.remove(vUserColours);
\r
675 * Method removeUserColoursAt.
\r
678 * @return the element removed from the collection
\r
680 public jalview.schemabinding.version2.UserColours removeUserColoursAt(
\r
682 java.lang.Object obj = this._userColoursList.remove(index);
\r
683 return (jalview.schemabinding.version2.UserColours) obj;
\r
687 * Method removeViewport.
\r
690 * @return true if the object was removed from the collection.
\r
692 public boolean removeViewport(
\r
693 final jalview.schemabinding.version2.Viewport vViewport) {
\r
694 boolean removed = _viewportList.remove(vViewport);
\r
699 * Method removeViewportAt.
\r
702 * @return the element removed from the collection
\r
704 public jalview.schemabinding.version2.Viewport removeViewportAt(
\r
706 java.lang.Object obj = this._viewportList.remove(index);
\r
707 return (jalview.schemabinding.version2.Viewport) obj;
\r
711 * Sets the value of field 'featureSettings'.
\r
713 * @param featureSettings the value of field 'featureSettings'.
\r
715 public void setFeatureSettings(
\r
716 final jalview.schemabinding.version2.FeatureSettings featureSettings) {
\r
717 this._featureSettings = featureSettings;
\r
725 * @throws java.lang.IndexOutOfBoundsException if the index
\r
726 * given is outside the bounds of the collection
\r
728 public void setJGroup(
\r
730 final jalview.schemabinding.version2.JGroup vJGroup)
\r
731 throws java.lang.IndexOutOfBoundsException {
\r
732 // check bounds for index
\r
733 if (index < 0 || index >= this._JGroupList.size()) {
\r
734 throw new IndexOutOfBoundsException("setJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
\r
737 this._JGroupList.set(index, vJGroup);
\r
743 * @param vJGroupArray
\r
745 public void setJGroup(
\r
746 final jalview.schemabinding.version2.JGroup[] vJGroupArray) {
\r
748 _JGroupList.clear();
\r
750 for (int i = 0; i < vJGroupArray.length; i++) {
\r
751 this._JGroupList.add(vJGroupArray[i]);
\r
760 * @throws java.lang.IndexOutOfBoundsException if the index
\r
761 * given is outside the bounds of the collection
\r
763 public void setJSeq(
\r
765 final jalview.schemabinding.version2.JSeq vJSeq)
\r
766 throws java.lang.IndexOutOfBoundsException {
\r
767 // check bounds for index
\r
768 if (index < 0 || index >= this._JSeqList.size()) {
\r
769 throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
\r
772 this._JSeqList.set(index, vJSeq);
\r
778 * @param vJSeqArray
\r
780 public void setJSeq(
\r
781 final jalview.schemabinding.version2.JSeq[] vJSeqArray) {
\r
785 for (int i = 0; i < vJSeqArray.length; i++) {
\r
786 this._JSeqList.add(vJSeqArray[i]);
\r
795 * @throws java.lang.IndexOutOfBoundsException if the index
\r
796 * given is outside the bounds of the collection
\r
798 public void setTree(
\r
800 final jalview.schemabinding.version2.Tree vTree)
\r
801 throws java.lang.IndexOutOfBoundsException {
\r
802 // check bounds for index
\r
803 if (index < 0 || index >= this._treeList.size()) {
\r
804 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
\r
807 this._treeList.set(index, vTree);
\r
813 * @param vTreeArray
\r
815 public void setTree(
\r
816 final jalview.schemabinding.version2.Tree[] vTreeArray) {
\r
820 for (int i = 0; i < vTreeArray.length; i++) {
\r
821 this._treeList.add(vTreeArray[i]);
\r
829 * @param vUserColours
\r
830 * @throws java.lang.IndexOutOfBoundsException if the index
\r
831 * given is outside the bounds of the collection
\r
833 public void setUserColours(
\r
835 final jalview.schemabinding.version2.UserColours vUserColours)
\r
836 throws java.lang.IndexOutOfBoundsException {
\r
837 // check bounds for index
\r
838 if (index < 0 || index >= this._userColoursList.size()) {
\r
839 throw new IndexOutOfBoundsException("setUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
\r
842 this._userColoursList.set(index, vUserColours);
\r
848 * @param vUserColoursArray
\r
850 public void setUserColours(
\r
851 final jalview.schemabinding.version2.UserColours[] vUserColoursArray) {
\r
853 _userColoursList.clear();
\r
855 for (int i = 0; i < vUserColoursArray.length; i++) {
\r
856 this._userColoursList.add(vUserColoursArray[i]);
\r
865 * @throws java.lang.IndexOutOfBoundsException if the index
\r
866 * given is outside the bounds of the collection
\r
868 public void setViewport(
\r
870 final jalview.schemabinding.version2.Viewport vViewport)
\r
871 throws java.lang.IndexOutOfBoundsException {
\r
872 // check bounds for index
\r
873 if (index < 0 || index >= this._viewportList.size()) {
\r
874 throw new IndexOutOfBoundsException("setViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
\r
877 this._viewportList.set(index, vViewport);
\r
883 * @param vViewportArray
\r
885 public void setViewport(
\r
886 final jalview.schemabinding.version2.Viewport[] vViewportArray) {
\r
888 _viewportList.clear();
\r
890 for (int i = 0; i < vViewportArray.length; i++) {
\r
891 this._viewportList.add(vViewportArray[i]);
\r
896 * Method unmarshal.
\r
899 * @throws org.exolab.castor.xml.MarshalException if object is
\r
900 * null or if any SAXException is thrown during marshaling
\r
901 * @throws org.exolab.castor.xml.ValidationException if this
\r
902 * object is an invalid instance according to the schema
\r
903 * @return the unmarshaled
\r
904 * jalview.schemabinding.version2.JalviewModelSequence
\r
906 public static jalview.schemabinding.version2.JalviewModelSequence unmarshal(
\r
907 final java.io.Reader reader)
\r
908 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
909 return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewModelSequence.class, reader);
\r
915 * @throws org.exolab.castor.xml.ValidationException if this
\r
916 * object is an invalid instance according to the schema
\r
918 public void validate(
\r
920 throws org.exolab.castor.xml.ValidationException {
\r
921 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
922 validator.validate(this);
\r