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;
18 * Class JalviewModelSequence.
20 * @version $Revision$ $Date$
22 public class JalviewModelSequence implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
32 private java.util.Vector _JSeqList;
37 private java.util.Vector _JGroupList;
40 * Field _viewportList.
42 private java.util.Vector _viewportList;
45 * Field _userColoursList.
47 private java.util.Vector _userColoursList;
52 private java.util.Vector _treeList;
55 * Field _featureSettings.
57 private jalview.schemabinding.version2.FeatureSettings _featureSettings;
60 * List of external trees
62 private java.util.Vector<jalview.ext.treeviewer.TreeFrameI> _extTreeList;
68 public JalviewModelSequence()
71 this._JSeqList = new java.util.Vector();
72 this._JGroupList = new java.util.Vector();
73 this._viewportList = new java.util.Vector();
74 this._userColoursList = new java.util.Vector();
75 this._treeList = new java.util.Vector();
76 this._extTreeList = new java.util.Vector<>();
87 * @throws java.lang.IndexOutOfBoundsException
88 * if the index given is outside the bounds of the collection
90 public void addJGroup(final jalview.schemabinding.version2.JGroup vJGroup)
91 throws java.lang.IndexOutOfBoundsException
93 this._JGroupList.addElement(vJGroup);
101 * @throws java.lang.IndexOutOfBoundsException
102 * if the index given is outside the bounds of the collection
104 public void addJGroup(final int index,
105 final jalview.schemabinding.version2.JGroup vJGroup)
106 throws java.lang.IndexOutOfBoundsException
108 this._JGroupList.add(index, vJGroup);
115 * @throws java.lang.IndexOutOfBoundsException
116 * if the index given is outside the bounds of the collection
118 public void addJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
119 throws java.lang.IndexOutOfBoundsException
121 this._JSeqList.addElement(vJSeq);
129 * @throws java.lang.IndexOutOfBoundsException
130 * if the index given is outside the bounds of the collection
132 public void addJSeq(final int index,
133 final jalview.schemabinding.version2.JSeq vJSeq)
134 throws java.lang.IndexOutOfBoundsException
136 this._JSeqList.add(index, vJSeq);
143 * @throws java.lang.IndexOutOfBoundsException
144 * if the index given is outside the bounds of the collection
146 public void addTree(final jalview.schemabinding.version2.Tree vTree)
147 throws java.lang.IndexOutOfBoundsException
149 this._treeList.addElement(vTree);
157 * @throws java.lang.IndexOutOfBoundsException
158 * if the index given is outside the bounds of the collection
160 public void addTree(final int index,
161 final jalview.schemabinding.version2.Tree vTree)
162 throws java.lang.IndexOutOfBoundsException
164 this._treeList.add(index, vTree);
172 public void addExtTreeViewer(jalview.ext.treeviewer.TreeFrameI treeViewer)
174 this._extTreeList.add(treeViewer);
183 public void addExtTreeViewer(final int index,
184 jalview.ext.treeviewer.TreeFrameI treeViewer)
186 this._extTreeList.add(index, treeViewer);
191 * @param vUserColours
192 * @throws java.lang.IndexOutOfBoundsException
193 * if the index given is outside the bounds of the collection
195 public void addUserColours(
196 final jalview.schemabinding.version2.UserColours vUserColours)
197 throws java.lang.IndexOutOfBoundsException
199 this._userColoursList.addElement(vUserColours);
206 * @param vUserColours
207 * @throws java.lang.IndexOutOfBoundsException
208 * if the index given is outside the bounds of the collection
210 public void addUserColours(final int index,
211 final jalview.schemabinding.version2.UserColours vUserColours)
212 throws java.lang.IndexOutOfBoundsException
214 this._userColoursList.add(index, vUserColours);
221 * @throws java.lang.IndexOutOfBoundsException
222 * if the index given is outside the bounds of the collection
224 public void addViewport(
225 final jalview.schemabinding.version2.Viewport vViewport)
226 throws java.lang.IndexOutOfBoundsException
228 this._viewportList.addElement(vViewport);
236 * @throws java.lang.IndexOutOfBoundsException
237 * if the index given is outside the bounds of the collection
239 public void addViewport(final int index,
240 final jalview.schemabinding.version2.Viewport vViewport)
241 throws java.lang.IndexOutOfBoundsException
243 this._viewportList.add(index, vViewport);
247 * Method enumerateJGroup.
249 * @return an Enumeration over all jalview.schemabinding.version2.JGroup
252 public java.util.Enumeration enumerateJGroup()
254 return this._JGroupList.elements();
258 * Method enumerateJSeq.
260 * @return an Enumeration over all jalview.schemabinding.version2.JSeq
263 public java.util.Enumeration enumerateJSeq()
265 return this._JSeqList.elements();
269 * Method enumerateTree.
271 * @return an Enumeration over all jalview.schemabinding.version2.Tree
274 public java.util.Enumeration enumerateTree()
276 return this._treeList.elements();
280 * Method enumerateUserColours.
282 * @return an Enumeration over all jalview.schemabinding.version2.UserColours
285 public java.util.Enumeration enumerateUserColours()
287 return this._userColoursList.elements();
291 * Method enumerateViewport.
293 * @return an Enumeration over all jalview.schemabinding.version2.Viewport
296 public java.util.Enumeration enumerateViewport()
298 return this._viewportList.elements();
302 * Returns the value of field 'featureSettings'.
304 * @return the value of field 'FeatureSettings'.
306 public jalview.schemabinding.version2.FeatureSettings getFeatureSettings()
308 return this._featureSettings;
315 * @throws java.lang.IndexOutOfBoundsException
316 * if the index given is outside the bounds of the collection
317 * @return the value of the jalview.schemabinding.version2.JGroup at the given
320 public jalview.schemabinding.version2.JGroup getJGroup(final int index)
321 throws java.lang.IndexOutOfBoundsException
323 // check bounds for index
324 if (index < 0 || index >= this._JGroupList.size())
326 throw new IndexOutOfBoundsException("getJGroup: Index value '"
327 + index + "' not in range [0.."
328 + (this._JGroupList.size() - 1) + "]");
331 return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
335 * Method getJGroup.Returns the contents of the collection in an Array.
337 * Note: Just in case the collection contents are changing in another thread,
338 * we pass a 0-length Array of the correct type into the API call. This way we
339 * <i>know</i> that the Array returned is of exactly the correct length.
341 * @return this collection as an Array
343 public jalview.schemabinding.version2.JGroup[] getJGroup()
345 jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0];
346 return (jalview.schemabinding.version2.JGroup[]) this._JGroupList
351 * Method getJGroupCount.
353 * @return the size of this collection
355 public int getJGroupCount()
357 return this._JGroupList.size();
364 * @throws java.lang.IndexOutOfBoundsException
365 * if the index given is outside the bounds of the collection
366 * @return the value of the jalview.schemabinding.version2.JSeq at the given
369 public jalview.schemabinding.version2.JSeq getJSeq(final int index)
370 throws java.lang.IndexOutOfBoundsException
372 // check bounds for index
373 if (index < 0 || index >= this._JSeqList.size())
375 throw new IndexOutOfBoundsException("getJSeq: Index value '" + index
376 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
379 return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
383 * Method getJSeq.Returns the contents of the collection in an Array.
385 * Note: Just in case the collection contents are changing in another thread,
386 * we pass a 0-length Array of the correct type into the API call. This way we
387 * <i>know</i> that the Array returned is of exactly the correct length.
389 * @return this collection as an Array
391 public jalview.schemabinding.version2.JSeq[] getJSeq()
393 jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0];
394 return (jalview.schemabinding.version2.JSeq[]) this._JSeqList
399 * Method getJSeqCount.
401 * @return the size of this collection
403 public int getJSeqCount()
405 return this._JSeqList.size();
412 * @throws java.lang.IndexOutOfBoundsException
413 * if the index given is outside the bounds of the collection
414 * @return the value of the jalview.schemabinding.version2.Tree at the given
417 public jalview.schemabinding.version2.Tree getTree(final int index)
418 throws java.lang.IndexOutOfBoundsException
420 // check bounds for index
421 if (index < 0 || index >= this._treeList.size())
423 throw new IndexOutOfBoundsException("getTree: Index value '" + index
424 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
427 return (jalview.schemabinding.version2.Tree) _treeList.get(index);
431 * Method getTree.Returns the contents of the collection in an Array.
433 * Note: Just in case the collection contents are changing in another thread,
434 * we pass a 0-length Array of the correct type into the API call. This way we
435 * <i>know</i> that the Array returned is of exactly the correct length.
437 * @return this collection as an Array
439 public jalview.schemabinding.version2.Tree[] getTree()
441 jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0];
442 return (jalview.schemabinding.version2.Tree[]) this._treeList
447 * Method getTreeCount.
449 * @return the size of this collection
451 public int getTreeCount()
453 return this._treeList.size();
461 * @throws java.lang.IndexOutOfBoundsException
463 public jalview.ext.treeviewer.TreeFrameI getExtTreeViewer(final int index)
464 throws java.lang.IndexOutOfBoundsException
466 // check bounds for index
467 if (index < 0 || index >= this._extTreeList.size())
469 throw new IndexOutOfBoundsException("getExtTreeViewer: Index value '"
470 + index + "' not in range [0.."
471 + (this._extTreeList.size() - 1) + "]");
474 return _extTreeList.get(index);
482 public jalview.ext.treeviewer.TreeFrameI[] getExtTreeViewer()
484 jalview.ext.treeviewer.TreeFrameI[] array = new jalview.ext.treeviewer.TreeFrameI[0];
485 return this._extTreeList.toArray(array);
493 public int getExtTreeViewerCount()
495 return this._extTreeList.size();
499 * Method getUserColours.
502 * @throws java.lang.IndexOutOfBoundsException
503 * if the index given is outside the bounds of the collection
504 * @return the value of the jalview.schemabinding.version2.UserColours at the
507 public jalview.schemabinding.version2.UserColours getUserColours(
508 final int index) throws java.lang.IndexOutOfBoundsException
510 // check bounds for index
511 if (index < 0 || index >= this._userColoursList.size())
513 throw new IndexOutOfBoundsException("getUserColours: Index value '"
514 + index + "' not in range [0.."
515 + (this._userColoursList.size() - 1) + "]");
518 return (jalview.schemabinding.version2.UserColours) _userColoursList
523 * Method getUserColours.Returns the contents of the collection in an Array.
525 * Note: Just in case the collection contents are changing in another thread,
526 * we pass a 0-length Array of the correct type into the API call. This way we
527 * <i>know</i> that the Array returned is of exactly the correct length.
529 * @return this collection as an Array
531 public jalview.schemabinding.version2.UserColours[] getUserColours()
533 jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0];
534 return (jalview.schemabinding.version2.UserColours[]) this._userColoursList
539 * Method getUserColoursCount.
541 * @return the size of this collection
543 public int getUserColoursCount()
545 return this._userColoursList.size();
549 * Method getViewport.
552 * @throws java.lang.IndexOutOfBoundsException
553 * if the index given is outside the bounds of the collection
554 * @return the value of the jalview.schemabinding.version2.Viewport at the
557 public jalview.schemabinding.version2.Viewport getViewport(final int index)
558 throws java.lang.IndexOutOfBoundsException
560 // check bounds for index
561 if (index < 0 || index >= this._viewportList.size())
563 throw new IndexOutOfBoundsException("getViewport: Index value '"
564 + index + "' not in range [0.."
565 + (this._viewportList.size() - 1) + "]");
568 return (jalview.schemabinding.version2.Viewport) _viewportList
573 * Method getViewport.Returns the contents of the collection in an Array.
575 * Note: Just in case the collection contents are changing in another thread,
576 * we pass a 0-length Array of the correct type into the API call. This way we
577 * <i>know</i> that the Array returned is of exactly the correct length.
579 * @return this collection as an Array
581 public jalview.schemabinding.version2.Viewport[] getViewport()
583 jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0];
584 return (jalview.schemabinding.version2.Viewport[]) this._viewportList
589 * Method getViewportCount.
591 * @return the size of this collection
593 public int getViewportCount()
595 return this._viewportList.size();
601 * @return true if this object is valid according to the schema
603 public boolean isValid()
608 } catch (org.exolab.castor.xml.ValidationException vex)
619 * @throws org.exolab.castor.xml.MarshalException
620 * if object is null or if any SAXException is thrown during
622 * @throws org.exolab.castor.xml.ValidationException
623 * if this object is an invalid instance according to the schema
625 public void marshal(final java.io.Writer out)
626 throws org.exolab.castor.xml.MarshalException,
627 org.exolab.castor.xml.ValidationException
629 Marshaller.marshal(this, out);
636 * @throws java.io.IOException
637 * if an IOException occurs during marshaling
638 * @throws org.exolab.castor.xml.ValidationException
639 * if this object is an invalid instance according to the schema
640 * @throws org.exolab.castor.xml.MarshalException
641 * if object is null or if any SAXException is thrown during
644 public void marshal(final org.xml.sax.ContentHandler handler)
645 throws java.io.IOException,
646 org.exolab.castor.xml.MarshalException,
647 org.exolab.castor.xml.ValidationException
649 Marshaller.marshal(this, handler);
654 public void removeAllJGroup()
656 this._JGroupList.clear();
661 public void removeAllJSeq()
663 this._JSeqList.clear();
668 public void removeAllTree()
670 this._treeList.clear();
675 public void removeAllUserColours()
677 this._userColoursList.clear();
682 public void removeAllViewport()
684 this._viewportList.clear();
688 * Method removeJGroup.
691 * @return true if the object was removed from the collection.
693 public boolean removeJGroup(
694 final jalview.schemabinding.version2.JGroup vJGroup)
696 boolean removed = _JGroupList.remove(vJGroup);
701 * Method removeJGroupAt.
704 * @return the element removed from the collection
706 public jalview.schemabinding.version2.JGroup removeJGroupAt(
709 java.lang.Object obj = this._JGroupList.remove(index);
710 return (jalview.schemabinding.version2.JGroup) obj;
717 * @return true if the object was removed from the collection.
719 public boolean removeJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
721 boolean removed = _JSeqList.remove(vJSeq);
726 * Method removeJSeqAt.
729 * @return the element removed from the collection
731 public jalview.schemabinding.version2.JSeq removeJSeqAt(final int index)
733 java.lang.Object obj = this._JSeqList.remove(index);
734 return (jalview.schemabinding.version2.JSeq) obj;
741 * @return true if the object was removed from the collection.
743 public boolean removeTree(final jalview.schemabinding.version2.Tree vTree)
745 boolean removed = _treeList.remove(vTree);
750 * Method removeTreeAt.
753 * @return the element removed from the collection
755 public jalview.schemabinding.version2.Tree removeTreeAt(final int index)
757 java.lang.Object obj = this._treeList.remove(index);
758 return (jalview.schemabinding.version2.Tree) obj;
762 * Method removeUserColours.
764 * @param vUserColours
765 * @return true if the object was removed from the collection.
767 public boolean removeUserColours(
768 final jalview.schemabinding.version2.UserColours vUserColours)
770 boolean removed = _userColoursList.remove(vUserColours);
775 * Method removeUserColoursAt.
778 * @return the element removed from the collection
780 public jalview.schemabinding.version2.UserColours removeUserColoursAt(
783 java.lang.Object obj = this._userColoursList.remove(index);
784 return (jalview.schemabinding.version2.UserColours) obj;
788 * Method removeViewport.
791 * @return true if the object was removed from the collection.
793 public boolean removeViewport(
794 final jalview.schemabinding.version2.Viewport vViewport)
796 boolean removed = _viewportList.remove(vViewport);
801 * Method removeViewportAt.
804 * @return the element removed from the collection
806 public jalview.schemabinding.version2.Viewport removeViewportAt(
809 java.lang.Object obj = this._viewportList.remove(index);
810 return (jalview.schemabinding.version2.Viewport) obj;
814 * Sets the value of field 'featureSettings'.
816 * @param featureSettings
817 * the value of field 'featureSettings'.
819 public void setFeatureSettings(
820 final jalview.schemabinding.version2.FeatureSettings featureSettings)
822 this._featureSettings = featureSettings;
830 * @throws java.lang.IndexOutOfBoundsException
831 * if the index given is outside the bounds of the collection
833 public void setJGroup(final int index,
834 final jalview.schemabinding.version2.JGroup vJGroup)
835 throws java.lang.IndexOutOfBoundsException
837 // check bounds for index
838 if (index < 0 || index >= this._JGroupList.size())
840 throw new IndexOutOfBoundsException("setJGroup: Index value '"
841 + index + "' not in range [0.."
842 + (this._JGroupList.size() - 1) + "]");
845 this._JGroupList.set(index, vJGroup);
851 * @param vJGroupArray
853 public void setJGroup(
854 final jalview.schemabinding.version2.JGroup[] vJGroupArray)
859 for (int i = 0; i < vJGroupArray.length; i++)
861 this._JGroupList.add(vJGroupArray[i]);
870 * @throws java.lang.IndexOutOfBoundsException
871 * if the index given is outside the bounds of the collection
873 public void setJSeq(final int index,
874 final jalview.schemabinding.version2.JSeq vJSeq)
875 throws java.lang.IndexOutOfBoundsException
877 // check bounds for index
878 if (index < 0 || index >= this._JSeqList.size())
880 throw new IndexOutOfBoundsException("setJSeq: Index value '" + index
881 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
884 this._JSeqList.set(index, vJSeq);
892 public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray)
897 for (int i = 0; i < vJSeqArray.length; i++)
899 this._JSeqList.add(vJSeqArray[i]);
908 * @throws java.lang.IndexOutOfBoundsException
909 * if the index given is outside the bounds of the collection
911 public void setTree(final int index,
912 final jalview.schemabinding.version2.Tree vTree)
913 throws java.lang.IndexOutOfBoundsException
915 // check bounds for index
916 if (index < 0 || index >= this._treeList.size())
918 throw new IndexOutOfBoundsException("setTree: Index value '" + index
919 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
922 this._treeList.set(index, vTree);
930 public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray)
935 for (int i = 0; i < vTreeArray.length; i++)
937 this._treeList.add(vTreeArray[i]);
945 * @param vUserColours
946 * @throws java.lang.IndexOutOfBoundsException
947 * if the index given is outside the bounds of the collection
949 public void setUserColours(final int index,
950 final jalview.schemabinding.version2.UserColours vUserColours)
951 throws java.lang.IndexOutOfBoundsException
953 // check bounds for index
954 if (index < 0 || index >= this._userColoursList.size())
956 throw new IndexOutOfBoundsException("setUserColours: Index value '"
957 + index + "' not in range [0.."
958 + (this._userColoursList.size() - 1) + "]");
961 this._userColoursList.set(index, vUserColours);
967 * @param vUserColoursArray
969 public void setUserColours(
970 final jalview.schemabinding.version2.UserColours[] vUserColoursArray)
973 _userColoursList.clear();
975 for (int i = 0; i < vUserColoursArray.length; i++)
977 this._userColoursList.add(vUserColoursArray[i]);
986 * @throws java.lang.IndexOutOfBoundsException
987 * if the index given is outside the bounds of the collection
989 public void setViewport(final int index,
990 final jalview.schemabinding.version2.Viewport vViewport)
991 throws java.lang.IndexOutOfBoundsException
993 // check bounds for index
994 if (index < 0 || index >= this._viewportList.size())
996 throw new IndexOutOfBoundsException("setViewport: Index value '"
997 + index + "' not in range [0.."
998 + (this._viewportList.size() - 1) + "]");
1001 this._viewportList.set(index, vViewport);
1007 * @param vViewportArray
1009 public void setViewport(
1010 final jalview.schemabinding.version2.Viewport[] vViewportArray)
1013 _viewportList.clear();
1015 for (int i = 0; i < vViewportArray.length; i++)
1017 this._viewportList.add(vViewportArray[i]);
1025 * @throws org.exolab.castor.xml.MarshalException
1026 * if object is null or if any SAXException is thrown during
1028 * @throws org.exolab.castor.xml.ValidationException
1029 * if this object is an invalid instance according to the schema
1030 * @return the unmarshaled jalview.schemabinding.version2.JalviewModelSequence
1032 public static jalview.schemabinding.version2.JalviewModelSequence unmarshal(
1033 final java.io.Reader reader)
1034 throws org.exolab.castor.xml.MarshalException,
1035 org.exolab.castor.xml.ValidationException
1037 return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller
1039 jalview.schemabinding.version2.JalviewModelSequence.class,
1046 * @throws org.exolab.castor.xml.ValidationException
1047 * if this object is an invalid instance according to the schema
1049 public void validate() throws org.exolab.castor.xml.ValidationException
1051 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1052 validator.validate(this);